diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/AddressesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/AddressesClientSnippets.g.cs index 49032a469698..f17b7f0d84d9 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/AddressesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/AddressesClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedAddressesClientSnippets @@ -234,7 +235,23 @@ public void DeleteRequestObject() Address = "", }; // Make the request - Operation response = addressesClient.Delete(request); + lro::Operation response = addressesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = addressesClient.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 } @@ -254,7 +271,23 @@ public async Task DeleteRequestObjectAsync() Address = "", }; // Make the request - Operation response = await addressesClient.DeleteAsync(request); + lro::Operation response = await addressesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await addressesClient.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 } @@ -269,7 +302,23 @@ public void Delete() string region = ""; string address = ""; // Make the request - Operation response = addressesClient.Delete(project, region, address); + lro::Operation response = addressesClient.Delete(project, region, address); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = addressesClient.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 } @@ -285,7 +334,23 @@ public async Task DeleteAsync() string region = ""; string address = ""; // Make the request - Operation response = await addressesClient.DeleteAsync(project, region, address); + lro::Operation response = await addressesClient.DeleteAsync(project, region, address); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await addressesClient.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 } @@ -372,7 +437,23 @@ public void InsertRequestObject() AddressResource = new Address(), }; // Make the request - Operation response = addressesClient.Insert(request); + lro::Operation response = addressesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = addressesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -392,7 +473,23 @@ public async Task InsertRequestObjectAsync() AddressResource = new Address(), }; // Make the request - Operation response = await addressesClient.InsertAsync(request); + lro::Operation response = await addressesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await addressesClient.PollOnceInsertAsync(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 } @@ -407,7 +504,23 @@ public void Insert() string region = ""; Address addressResource = new Address(); // Make the request - Operation response = addressesClient.Insert(project, region, addressResource); + lro::Operation response = addressesClient.Insert(project, region, addressResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = addressesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -423,7 +536,23 @@ public async Task InsertAsync() string region = ""; Address addressResource = new Address(); // Make the request - Operation response = await addressesClient.InsertAsync(project, region, addressResource); + lro::Operation response = await addressesClient.InsertAsync(project, region, addressResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await addressesClient.PollOnceInsertAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/AutoscalersClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/AutoscalersClientSnippets.g.cs index 8cefb4499b33..640d580f8dc6 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/AutoscalersClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/AutoscalersClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedAutoscalersClientSnippets @@ -234,7 +235,23 @@ public void DeleteRequestObject() Autoscaler = "", }; // Make the request - Operation response = autoscalersClient.Delete(request); + lro::Operation response = autoscalersClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 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 } @@ -254,7 +271,23 @@ public async Task DeleteRequestObjectAsync() Autoscaler = "", }; // Make the request - Operation response = await autoscalersClient.DeleteAsync(request); + lro::Operation response = await autoscalersClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 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 } @@ -269,7 +302,23 @@ public void Delete() string zone = ""; string autoscaler = ""; // Make the request - Operation response = autoscalersClient.Delete(project, zone, autoscaler); + lro::Operation response = autoscalersClient.Delete(project, zone, autoscaler); + + // Poll until the returned long-running operation is complete + lro::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 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 } @@ -285,7 +334,23 @@ public async Task DeleteAsync() string zone = ""; string autoscaler = ""; // Make the request - Operation response = await autoscalersClient.DeleteAsync(project, zone, autoscaler); + lro::Operation response = await autoscalersClient.DeleteAsync(project, zone, autoscaler); + + // Poll until the returned long-running operation is complete + lro::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 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 } @@ -372,7 +437,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = autoscalersClient.Insert(request); + lro::Operation response = autoscalersClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = autoscalersClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -392,7 +473,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await autoscalersClient.InsertAsync(request); + lro::Operation response = await autoscalersClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await autoscalersClient.PollOnceInsertAsync(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 } @@ -407,7 +504,23 @@ public void Insert() string zone = ""; Autoscaler autoscalerResource = new Autoscaler(); // Make the request - Operation response = autoscalersClient.Insert(project, zone, autoscalerResource); + lro::Operation response = autoscalersClient.Insert(project, zone, autoscalerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = autoscalersClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -423,7 +536,23 @@ public async Task InsertAsync() string zone = ""; Autoscaler autoscalerResource = new Autoscaler(); // Make the request - Operation response = await autoscalersClient.InsertAsync(project, zone, autoscalerResource); + lro::Operation response = await autoscalersClient.InsertAsync(project, zone, autoscalerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await autoscalersClient.PollOnceInsertAsync(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 } @@ -639,7 +768,23 @@ public void PatchRequestObject() Autoscaler = "", }; // Make the request - Operation response = autoscalersClient.Patch(request); + lro::Operation response = autoscalersClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = autoscalersClient.PollOncePatch(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 } @@ -660,7 +805,23 @@ public async Task PatchRequestObjectAsync() Autoscaler = "", }; // Make the request - Operation response = await autoscalersClient.PatchAsync(request); + lro::Operation response = await autoscalersClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 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 } @@ -675,7 +836,23 @@ public void Patch() string zone = ""; Autoscaler autoscalerResource = new Autoscaler(); // Make the request - Operation response = autoscalersClient.Patch(project, zone, autoscalerResource); + lro::Operation response = autoscalersClient.Patch(project, zone, autoscalerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = autoscalersClient.PollOncePatch(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 } @@ -691,7 +868,23 @@ public async Task PatchAsync() string zone = ""; Autoscaler autoscalerResource = new Autoscaler(); // Make the request - Operation response = await autoscalersClient.PatchAsync(project, zone, autoscalerResource); + lro::Operation response = await autoscalersClient.PatchAsync(project, zone, autoscalerResource); + + // Poll until the returned long-running operation is complete + lro::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 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 } @@ -711,7 +904,23 @@ public void UpdateRequestObject() Autoscaler = "", }; // Make the request - Operation response = autoscalersClient.Update(request); + lro::Operation response = autoscalersClient.Update(request); + + // Poll until the returned long-running operation is complete + lro::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 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 } @@ -732,7 +941,23 @@ public async Task UpdateRequestObjectAsync() Autoscaler = "", }; // Make the request - Operation response = await autoscalersClient.UpdateAsync(request); + lro::Operation response = await autoscalersClient.UpdateAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await autoscalersClient.PollOnceUpdateAsync(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 } @@ -747,7 +972,23 @@ public void Update() string zone = ""; Autoscaler autoscalerResource = new Autoscaler(); // Make the request - Operation response = autoscalersClient.Update(project, zone, autoscalerResource); + lro::Operation response = autoscalersClient.Update(project, zone, autoscalerResource); + + // Poll until the returned long-running operation is complete + lro::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 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 } @@ -763,7 +1004,23 @@ public async Task UpdateAsync() string zone = ""; Autoscaler autoscalerResource = new Autoscaler(); // Make the request - Operation response = await autoscalersClient.UpdateAsync(project, zone, autoscalerResource); + lro::Operation response = await autoscalersClient.UpdateAsync(project, zone, autoscalerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await autoscalersClient.PollOnceUpdateAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/BackendBucketsClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/BackendBucketsClientSnippets.g.cs index 8cb33fd8415d..13a6b9bd0a32 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/BackendBucketsClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/BackendBucketsClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedBackendBucketsClientSnippets @@ -39,7 +40,23 @@ public void AddSignedUrlKeyRequestObject() SignedUrlKeyResource = new SignedUrlKey(), }; // Make the request - Operation response = backendBucketsClient.AddSignedUrlKey(request); + lro::Operation response = backendBucketsClient.AddSignedUrlKey(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendBucketsClient.PollOnceAddSignedUrlKey(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 } @@ -59,7 +76,23 @@ public async Task AddSignedUrlKeyRequestObjectAsync() SignedUrlKeyResource = new SignedUrlKey(), }; // Make the request - Operation response = await backendBucketsClient.AddSignedUrlKeyAsync(request); + lro::Operation response = await backendBucketsClient.AddSignedUrlKeyAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendBucketsClient.PollOnceAddSignedUrlKeyAsync(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 } @@ -74,7 +107,23 @@ public void AddSignedUrlKey() string backendBucket = ""; SignedUrlKey signedUrlKeyResource = new SignedUrlKey(); // Make the request - Operation response = backendBucketsClient.AddSignedUrlKey(project, backendBucket, signedUrlKeyResource); + lro::Operation response = backendBucketsClient.AddSignedUrlKey(project, backendBucket, signedUrlKeyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendBucketsClient.PollOnceAddSignedUrlKey(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 } @@ -90,7 +139,23 @@ public async Task AddSignedUrlKeyAsync() string backendBucket = ""; SignedUrlKey signedUrlKeyResource = new SignedUrlKey(); // Make the request - Operation response = await backendBucketsClient.AddSignedUrlKeyAsync(project, backendBucket, signedUrlKeyResource); + lro::Operation response = await backendBucketsClient.AddSignedUrlKeyAsync(project, backendBucket, signedUrlKeyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendBucketsClient.PollOnceAddSignedUrlKeyAsync(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 } @@ -108,7 +173,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = backendBucketsClient.Delete(request); + lro::Operation response = backendBucketsClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendBucketsClient.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 } @@ -127,7 +208,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await backendBucketsClient.DeleteAsync(request); + lro::Operation response = await backendBucketsClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendBucketsClient.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 } @@ -141,7 +238,23 @@ public void Delete() string project = ""; string backendBucket = ""; // Make the request - Operation response = backendBucketsClient.Delete(project, backendBucket); + lro::Operation response = backendBucketsClient.Delete(project, backendBucket); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendBucketsClient.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 } @@ -156,7 +269,23 @@ public async Task DeleteAsync() string project = ""; string backendBucket = ""; // Make the request - Operation response = await backendBucketsClient.DeleteAsync(project, backendBucket); + lro::Operation response = await backendBucketsClient.DeleteAsync(project, backendBucket); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendBucketsClient.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 } @@ -175,7 +304,23 @@ public void DeleteSignedUrlKeyRequestObject() KeyName = "", }; // Make the request - Operation response = backendBucketsClient.DeleteSignedUrlKey(request); + lro::Operation response = backendBucketsClient.DeleteSignedUrlKey(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendBucketsClient.PollOnceDeleteSignedUrlKey(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 } @@ -195,7 +340,23 @@ public async Task DeleteSignedUrlKeyRequestObjectAsync() KeyName = "", }; // Make the request - Operation response = await backendBucketsClient.DeleteSignedUrlKeyAsync(request); + lro::Operation response = await backendBucketsClient.DeleteSignedUrlKeyAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendBucketsClient.PollOnceDeleteSignedUrlKeyAsync(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 } @@ -210,7 +371,23 @@ public void DeleteSignedUrlKey() string backendBucket = ""; string keyName = ""; // Make the request - Operation response = backendBucketsClient.DeleteSignedUrlKey(project, backendBucket, keyName); + lro::Operation response = backendBucketsClient.DeleteSignedUrlKey(project, backendBucket, keyName); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendBucketsClient.PollOnceDeleteSignedUrlKey(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 } @@ -226,7 +403,23 @@ public async Task DeleteSignedUrlKeyAsync() string backendBucket = ""; string keyName = ""; // Make the request - Operation response = await backendBucketsClient.DeleteSignedUrlKeyAsync(project, backendBucket, keyName); + lro::Operation response = await backendBucketsClient.DeleteSignedUrlKeyAsync(project, backendBucket, keyName); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendBucketsClient.PollOnceDeleteSignedUrlKeyAsync(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 } @@ -308,7 +501,23 @@ public void InsertRequestObject() BackendBucketResource = new BackendBucket(), }; // Make the request - Operation response = backendBucketsClient.Insert(request); + lro::Operation response = backendBucketsClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendBucketsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -327,7 +536,23 @@ public async Task InsertRequestObjectAsync() BackendBucketResource = new BackendBucket(), }; // Make the request - Operation response = await backendBucketsClient.InsertAsync(request); + lro::Operation response = await backendBucketsClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendBucketsClient.PollOnceInsertAsync(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 } @@ -341,7 +566,23 @@ public void Insert() string project = ""; BackendBucket backendBucketResource = new BackendBucket(); // Make the request - Operation response = backendBucketsClient.Insert(project, backendBucketResource); + lro::Operation response = backendBucketsClient.Insert(project, backendBucketResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendBucketsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -356,7 +597,23 @@ public async Task InsertAsync() string project = ""; BackendBucket backendBucketResource = new BackendBucket(); // Make the request - Operation response = await backendBucketsClient.InsertAsync(project, backendBucketResource); + lro::Operation response = await backendBucketsClient.InsertAsync(project, backendBucketResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendBucketsClient.PollOnceInsertAsync(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 } @@ -567,7 +824,23 @@ public void PatchRequestObject() BackendBucketResource = new BackendBucket(), }; // Make the request - Operation response = backendBucketsClient.Patch(request); + lro::Operation response = backendBucketsClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendBucketsClient.PollOncePatch(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 } @@ -587,7 +860,23 @@ public async Task PatchRequestObjectAsync() BackendBucketResource = new BackendBucket(), }; // Make the request - Operation response = await backendBucketsClient.PatchAsync(request); + lro::Operation response = await backendBucketsClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendBucketsClient.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 } @@ -602,7 +891,23 @@ public void Patch() string backendBucket = ""; BackendBucket backendBucketResource = new BackendBucket(); // Make the request - Operation response = backendBucketsClient.Patch(project, backendBucket, backendBucketResource); + lro::Operation response = backendBucketsClient.Patch(project, backendBucket, backendBucketResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendBucketsClient.PollOncePatch(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 } @@ -618,7 +923,23 @@ public async Task PatchAsync() string backendBucket = ""; BackendBucket backendBucketResource = new BackendBucket(); // Make the request - Operation response = await backendBucketsClient.PatchAsync(project, backendBucket, backendBucketResource); + lro::Operation response = await backendBucketsClient.PatchAsync(project, backendBucket, backendBucketResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendBucketsClient.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 } @@ -637,7 +958,23 @@ public void UpdateRequestObject() BackendBucketResource = new BackendBucket(), }; // Make the request - Operation response = backendBucketsClient.Update(request); + lro::Operation response = backendBucketsClient.Update(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendBucketsClient.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 } @@ -657,7 +994,23 @@ public async Task UpdateRequestObjectAsync() BackendBucketResource = new BackendBucket(), }; // Make the request - Operation response = await backendBucketsClient.UpdateAsync(request); + lro::Operation response = await backendBucketsClient.UpdateAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendBucketsClient.PollOnceUpdateAsync(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 } @@ -672,7 +1025,23 @@ public void Update() string backendBucket = ""; BackendBucket backendBucketResource = new BackendBucket(); // Make the request - Operation response = backendBucketsClient.Update(project, backendBucket, backendBucketResource); + lro::Operation response = backendBucketsClient.Update(project, backendBucket, backendBucketResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendBucketsClient.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 } @@ -688,7 +1057,23 @@ public async Task UpdateAsync() string backendBucket = ""; BackendBucket backendBucketResource = new BackendBucket(); // Make the request - Operation response = await backendBucketsClient.UpdateAsync(project, backendBucket, backendBucketResource); + lro::Operation response = await backendBucketsClient.UpdateAsync(project, backendBucket, backendBucketResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendBucketsClient.PollOnceUpdateAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/BackendServicesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/BackendServicesClientSnippets.g.cs index 705d6298b019..0a45a98079ae 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/BackendServicesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/BackendServicesClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedBackendServicesClientSnippets @@ -40,7 +41,23 @@ public void AddSignedUrlKeyRequestObject() SignedUrlKeyResource = new SignedUrlKey(), }; // Make the request - Operation response = backendServicesClient.AddSignedUrlKey(request); + lro::Operation response = backendServicesClient.AddSignedUrlKey(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendServicesClient.PollOnceAddSignedUrlKey(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 } @@ -60,7 +77,23 @@ public async Task AddSignedUrlKeyRequestObjectAsync() SignedUrlKeyResource = new SignedUrlKey(), }; // Make the request - Operation response = await backendServicesClient.AddSignedUrlKeyAsync(request); + lro::Operation response = await backendServicesClient.AddSignedUrlKeyAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendServicesClient.PollOnceAddSignedUrlKeyAsync(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 } @@ -75,7 +108,23 @@ public void AddSignedUrlKey() string backendService = ""; SignedUrlKey signedUrlKeyResource = new SignedUrlKey(); // Make the request - Operation response = backendServicesClient.AddSignedUrlKey(project, backendService, signedUrlKeyResource); + lro::Operation response = backendServicesClient.AddSignedUrlKey(project, backendService, signedUrlKeyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendServicesClient.PollOnceAddSignedUrlKey(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 } @@ -91,7 +140,23 @@ public async Task AddSignedUrlKeyAsync() string backendService = ""; SignedUrlKey signedUrlKeyResource = new SignedUrlKey(); // Make the request - Operation response = await backendServicesClient.AddSignedUrlKeyAsync(project, backendService, signedUrlKeyResource); + lro::Operation response = await backendServicesClient.AddSignedUrlKeyAsync(project, backendService, signedUrlKeyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendServicesClient.PollOnceAddSignedUrlKeyAsync(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 } @@ -303,7 +368,23 @@ public void DeleteRequestObject() BackendService = "", }; // Make the request - Operation response = backendServicesClient.Delete(request); + lro::Operation response = backendServicesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendServicesClient.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 } @@ -322,7 +403,23 @@ public async Task DeleteRequestObjectAsync() BackendService = "", }; // Make the request - Operation response = await backendServicesClient.DeleteAsync(request); + lro::Operation response = await backendServicesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendServicesClient.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 } @@ -336,7 +433,23 @@ public void Delete() string project = ""; string backendService = ""; // Make the request - Operation response = backendServicesClient.Delete(project, backendService); + lro::Operation response = backendServicesClient.Delete(project, backendService); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendServicesClient.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 } @@ -351,7 +464,23 @@ public async Task DeleteAsync() string project = ""; string backendService = ""; // Make the request - Operation response = await backendServicesClient.DeleteAsync(project, backendService); + lro::Operation response = await backendServicesClient.DeleteAsync(project, backendService); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendServicesClient.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 } @@ -370,7 +499,23 @@ public void DeleteSignedUrlKeyRequestObject() KeyName = "", }; // Make the request - Operation response = backendServicesClient.DeleteSignedUrlKey(request); + lro::Operation response = backendServicesClient.DeleteSignedUrlKey(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendServicesClient.PollOnceDeleteSignedUrlKey(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 } @@ -390,7 +535,23 @@ public async Task DeleteSignedUrlKeyRequestObjectAsync() KeyName = "", }; // Make the request - Operation response = await backendServicesClient.DeleteSignedUrlKeyAsync(request); + lro::Operation response = await backendServicesClient.DeleteSignedUrlKeyAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendServicesClient.PollOnceDeleteSignedUrlKeyAsync(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 } @@ -405,7 +566,23 @@ public void DeleteSignedUrlKey() string backendService = ""; string keyName = ""; // Make the request - Operation response = backendServicesClient.DeleteSignedUrlKey(project, backendService, keyName); + lro::Operation response = backendServicesClient.DeleteSignedUrlKey(project, backendService, keyName); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendServicesClient.PollOnceDeleteSignedUrlKey(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 } @@ -421,7 +598,23 @@ public async Task DeleteSignedUrlKeyAsync() string backendService = ""; string keyName = ""; // Make the request - Operation response = await backendServicesClient.DeleteSignedUrlKeyAsync(project, backendService, keyName); + lro::Operation response = await backendServicesClient.DeleteSignedUrlKeyAsync(project, backendService, keyName); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendServicesClient.PollOnceDeleteSignedUrlKeyAsync(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 } @@ -571,7 +764,23 @@ public void InsertRequestObject() BackendServiceResource = new BackendService(), }; // Make the request - Operation response = backendServicesClient.Insert(request); + lro::Operation response = backendServicesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendServicesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -590,7 +799,23 @@ public async Task InsertRequestObjectAsync() BackendServiceResource = new BackendService(), }; // Make the request - Operation response = await backendServicesClient.InsertAsync(request); + lro::Operation response = await backendServicesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendServicesClient.PollOnceInsertAsync(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 } @@ -604,7 +829,23 @@ public void Insert() string project = ""; BackendService backendServiceResource = new BackendService(); // Make the request - Operation response = backendServicesClient.Insert(project, backendServiceResource); + lro::Operation response = backendServicesClient.Insert(project, backendServiceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendServicesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -619,7 +860,23 @@ public async Task InsertAsync() string project = ""; BackendService backendServiceResource = new BackendService(); // Make the request - Operation response = await backendServicesClient.InsertAsync(project, backendServiceResource); + lro::Operation response = await backendServicesClient.InsertAsync(project, backendServiceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendServicesClient.PollOnceInsertAsync(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 } @@ -830,7 +1087,23 @@ public void PatchRequestObject() BackendServiceResource = new BackendService(), }; // Make the request - Operation response = backendServicesClient.Patch(request); + lro::Operation response = backendServicesClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendServicesClient.PollOncePatch(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 } @@ -850,7 +1123,23 @@ public async Task PatchRequestObjectAsync() BackendServiceResource = new BackendService(), }; // Make the request - Operation response = await backendServicesClient.PatchAsync(request); + lro::Operation response = await backendServicesClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendServicesClient.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 } @@ -865,7 +1154,23 @@ public void Patch() string backendService = ""; BackendService backendServiceResource = new BackendService(); // Make the request - Operation response = backendServicesClient.Patch(project, backendService, backendServiceResource); + lro::Operation response = backendServicesClient.Patch(project, backendService, backendServiceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendServicesClient.PollOncePatch(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 } @@ -881,7 +1186,23 @@ public async Task PatchAsync() string backendService = ""; BackendService backendServiceResource = new BackendService(); // Make the request - Operation response = await backendServicesClient.PatchAsync(project, backendService, backendServiceResource); + lro::Operation response = await backendServicesClient.PatchAsync(project, backendService, backendServiceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendServicesClient.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 } @@ -900,7 +1221,23 @@ public void SetSecurityPolicyRequestObject() BackendService = "", }; // Make the request - Operation response = backendServicesClient.SetSecurityPolicy(request); + lro::Operation response = backendServicesClient.SetSecurityPolicy(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendServicesClient.PollOnceSetSecurityPolicy(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 } @@ -920,7 +1257,23 @@ public async Task SetSecurityPolicyRequestObjectAsync() BackendService = "", }; // Make the request - Operation response = await backendServicesClient.SetSecurityPolicyAsync(request); + lro::Operation response = await backendServicesClient.SetSecurityPolicyAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendServicesClient.PollOnceSetSecurityPolicyAsync(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 } @@ -935,7 +1288,23 @@ public void SetSecurityPolicy() string backendService = ""; SecurityPolicyReference securityPolicyReferenceResource = new SecurityPolicyReference(); // Make the request - Operation response = backendServicesClient.SetSecurityPolicy(project, backendService, securityPolicyReferenceResource); + lro::Operation response = backendServicesClient.SetSecurityPolicy(project, backendService, securityPolicyReferenceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendServicesClient.PollOnceSetSecurityPolicy(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 } @@ -951,7 +1320,23 @@ public async Task SetSecurityPolicyAsync() string backendService = ""; SecurityPolicyReference securityPolicyReferenceResource = new SecurityPolicyReference(); // Make the request - Operation response = await backendServicesClient.SetSecurityPolicyAsync(project, backendService, securityPolicyReferenceResource); + lro::Operation response = await backendServicesClient.SetSecurityPolicyAsync(project, backendService, securityPolicyReferenceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendServicesClient.PollOnceSetSecurityPolicyAsync(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 } @@ -970,7 +1355,23 @@ public void UpdateRequestObject() BackendServiceResource = new BackendService(), }; // Make the request - Operation response = backendServicesClient.Update(request); + lro::Operation response = backendServicesClient.Update(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendServicesClient.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 } @@ -990,7 +1391,23 @@ public async Task UpdateRequestObjectAsync() BackendServiceResource = new BackendService(), }; // Make the request - Operation response = await backendServicesClient.UpdateAsync(request); + lro::Operation response = await backendServicesClient.UpdateAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendServicesClient.PollOnceUpdateAsync(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 } @@ -1005,7 +1422,23 @@ public void Update() string backendService = ""; BackendService backendServiceResource = new BackendService(); // Make the request - Operation response = backendServicesClient.Update(project, backendService, backendServiceResource); + lro::Operation response = backendServicesClient.Update(project, backendService, backendServiceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = backendServicesClient.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 } @@ -1021,7 +1454,23 @@ public async Task UpdateAsync() string backendService = ""; BackendService backendServiceResource = new BackendService(); // Make the request - Operation response = await backendServicesClient.UpdateAsync(project, backendService, backendServiceResource); + lro::Operation response = await backendServicesClient.UpdateAsync(project, backendService, backendServiceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await backendServicesClient.PollOnceUpdateAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/DisksClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/DisksClientSnippets.g.cs index f1268b1f2b27..b937fbd658cc 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/DisksClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/DisksClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedDisksClientSnippets @@ -41,7 +42,23 @@ public void AddResourcePoliciesRequestObject() DisksAddResourcePoliciesRequestResource = new DisksAddResourcePoliciesRequest(), }; // Make the request - Operation response = disksClient.AddResourcePolicies(request); + lro::Operation response = disksClient.AddResourcePolicies(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = disksClient.PollOnceAddResourcePolicies(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 } @@ -62,7 +79,23 @@ public async Task AddResourcePoliciesRequestObjectAsync() DisksAddResourcePoliciesRequestResource = new DisksAddResourcePoliciesRequest(), }; // Make the request - Operation response = await disksClient.AddResourcePoliciesAsync(request); + lro::Operation response = await disksClient.AddResourcePoliciesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await disksClient.PollOnceAddResourcePoliciesAsync(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 } @@ -78,7 +111,23 @@ public void AddResourcePolicies() string disk = ""; DisksAddResourcePoliciesRequest disksAddResourcePoliciesRequestResource = new DisksAddResourcePoliciesRequest(); // Make the request - Operation response = disksClient.AddResourcePolicies(project, zone, disk, disksAddResourcePoliciesRequestResource); + lro::Operation response = disksClient.AddResourcePolicies(project, zone, disk, disksAddResourcePoliciesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = disksClient.PollOnceAddResourcePolicies(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 } @@ -95,7 +144,23 @@ public async Task AddResourcePoliciesAsync() string disk = ""; DisksAddResourcePoliciesRequest disksAddResourcePoliciesRequestResource = new DisksAddResourcePoliciesRequest(); // Make the request - Operation response = await disksClient.AddResourcePoliciesAsync(project, zone, disk, disksAddResourcePoliciesRequestResource); + lro::Operation response = await disksClient.AddResourcePoliciesAsync(project, zone, disk, disksAddResourcePoliciesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await disksClient.PollOnceAddResourcePoliciesAsync(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 } @@ -310,7 +375,23 @@ public void CreateSnapshotRequestObject() SnapshotResource = new Snapshot(), }; // Make the request - Operation response = disksClient.CreateSnapshot(request); + lro::Operation response = disksClient.CreateSnapshot(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = disksClient.PollOnceCreateSnapshot(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 } @@ -332,7 +413,23 @@ public async Task CreateSnapshotRequestObjectAsync() SnapshotResource = new Snapshot(), }; // Make the request - Operation response = await disksClient.CreateSnapshotAsync(request); + lro::Operation response = await disksClient.CreateSnapshotAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await disksClient.PollOnceCreateSnapshotAsync(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 } @@ -348,7 +445,23 @@ public void CreateSnapshot() string disk = ""; Snapshot snapshotResource = new Snapshot(); // Make the request - Operation response = disksClient.CreateSnapshot(project, zone, disk, snapshotResource); + lro::Operation response = disksClient.CreateSnapshot(project, zone, disk, snapshotResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = disksClient.PollOnceCreateSnapshot(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 } @@ -365,7 +478,23 @@ public async Task CreateSnapshotAsync() string disk = ""; Snapshot snapshotResource = new Snapshot(); // Make the request - Operation response = await disksClient.CreateSnapshotAsync(project, zone, disk, snapshotResource); + lro::Operation response = await disksClient.CreateSnapshotAsync(project, zone, disk, snapshotResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await disksClient.PollOnceCreateSnapshotAsync(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 } @@ -384,7 +513,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = disksClient.Delete(request); + lro::Operation response = disksClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = disksClient.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 } @@ -404,7 +549,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await disksClient.DeleteAsync(request); + lro::Operation response = await disksClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await disksClient.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 } @@ -419,7 +580,23 @@ public void Delete() string zone = ""; string disk = ""; // Make the request - Operation response = disksClient.Delete(project, zone, disk); + lro::Operation response = disksClient.Delete(project, zone, disk); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = disksClient.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 } @@ -435,7 +612,23 @@ public async Task DeleteAsync() string zone = ""; string disk = ""; // Make the request - Operation response = await disksClient.DeleteAsync(project, zone, disk); + lro::Operation response = await disksClient.DeleteAsync(project, zone, disk); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await disksClient.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 } @@ -593,7 +786,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = disksClient.Insert(request); + lro::Operation response = disksClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = disksClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -614,7 +823,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await disksClient.InsertAsync(request); + lro::Operation response = await disksClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await disksClient.PollOnceInsertAsync(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 } @@ -629,7 +854,23 @@ public void Insert() string zone = ""; Disk diskResource = new Disk(); // Make the request - Operation response = disksClient.Insert(project, zone, diskResource); + lro::Operation response = disksClient.Insert(project, zone, diskResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = disksClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -645,7 +886,23 @@ public async Task InsertAsync() string zone = ""; Disk diskResource = new Disk(); // Make the request - Operation response = await disksClient.InsertAsync(project, zone, diskResource); + lro::Operation response = await disksClient.InsertAsync(project, zone, diskResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await disksClient.PollOnceInsertAsync(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 } @@ -861,7 +1118,23 @@ public void RemoveResourcePoliciesRequestObject() DisksRemoveResourcePoliciesRequestResource = new DisksRemoveResourcePoliciesRequest(), }; // Make the request - Operation response = disksClient.RemoveResourcePolicies(request); + lro::Operation response = disksClient.RemoveResourcePolicies(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = disksClient.PollOnceRemoveResourcePolicies(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 } @@ -882,7 +1155,23 @@ public async Task RemoveResourcePoliciesRequestObjectAsync() DisksRemoveResourcePoliciesRequestResource = new DisksRemoveResourcePoliciesRequest(), }; // Make the request - Operation response = await disksClient.RemoveResourcePoliciesAsync(request); + lro::Operation response = await disksClient.RemoveResourcePoliciesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await disksClient.PollOnceRemoveResourcePoliciesAsync(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 } @@ -898,7 +1187,23 @@ public void RemoveResourcePolicies() string disk = ""; DisksRemoveResourcePoliciesRequest disksRemoveResourcePoliciesRequestResource = new DisksRemoveResourcePoliciesRequest(); // Make the request - Operation response = disksClient.RemoveResourcePolicies(project, zone, disk, disksRemoveResourcePoliciesRequestResource); + lro::Operation response = disksClient.RemoveResourcePolicies(project, zone, disk, disksRemoveResourcePoliciesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = disksClient.PollOnceRemoveResourcePolicies(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 } @@ -915,7 +1220,23 @@ public async Task RemoveResourcePoliciesAsync() string disk = ""; DisksRemoveResourcePoliciesRequest disksRemoveResourcePoliciesRequestResource = new DisksRemoveResourcePoliciesRequest(); // Make the request - Operation response = await disksClient.RemoveResourcePoliciesAsync(project, zone, disk, disksRemoveResourcePoliciesRequestResource); + lro::Operation response = await disksClient.RemoveResourcePoliciesAsync(project, zone, disk, disksRemoveResourcePoliciesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await disksClient.PollOnceRemoveResourcePoliciesAsync(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 } @@ -935,7 +1256,23 @@ public void ResizeRequestObject() Project = "", }; // Make the request - Operation response = disksClient.Resize(request); + lro::Operation response = disksClient.Resize(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = disksClient.PollOnceResize(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 } @@ -956,7 +1293,23 @@ public async Task ResizeRequestObjectAsync() Project = "", }; // Make the request - Operation response = await disksClient.ResizeAsync(request); + lro::Operation response = await disksClient.ResizeAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await disksClient.PollOnceResizeAsync(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 } @@ -972,7 +1325,23 @@ public void Resize() string disk = ""; DisksResizeRequest disksResizeRequestResource = new DisksResizeRequest(); // Make the request - Operation response = disksClient.Resize(project, zone, disk, disksResizeRequestResource); + lro::Operation response = disksClient.Resize(project, zone, disk, disksResizeRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = disksClient.PollOnceResize(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 } @@ -989,7 +1358,23 @@ public async Task ResizeAsync() string disk = ""; DisksResizeRequest disksResizeRequestResource = new DisksResizeRequest(); // Make the request - Operation response = await disksClient.ResizeAsync(project, zone, disk, disksResizeRequestResource); + lro::Operation response = await disksClient.ResizeAsync(project, zone, disk, disksResizeRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await disksClient.PollOnceResizeAsync(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 } @@ -1081,7 +1466,23 @@ public void SetLabelsRequestObject() ZoneSetLabelsRequestResource = new ZoneSetLabelsRequest(), }; // Make the request - Operation response = disksClient.SetLabels(request); + lro::Operation response = disksClient.SetLabels(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = disksClient.PollOnceSetLabels(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -1102,7 +1503,23 @@ public async Task SetLabelsRequestObjectAsync() ZoneSetLabelsRequestResource = new ZoneSetLabelsRequest(), }; // Make the request - Operation response = await disksClient.SetLabelsAsync(request); + lro::Operation response = await disksClient.SetLabelsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await disksClient.PollOnceSetLabelsAsync(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 } @@ -1118,7 +1535,23 @@ public void SetLabels() string resource = ""; ZoneSetLabelsRequest zoneSetLabelsRequestResource = new ZoneSetLabelsRequest(); // Make the request - Operation response = disksClient.SetLabels(project, zone, resource, zoneSetLabelsRequestResource); + lro::Operation response = disksClient.SetLabels(project, zone, resource, zoneSetLabelsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = disksClient.PollOnceSetLabels(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -1135,7 +1568,23 @@ public async Task SetLabelsAsync() string resource = ""; ZoneSetLabelsRequest zoneSetLabelsRequestResource = new ZoneSetLabelsRequest(); // Make the request - Operation response = await disksClient.SetLabelsAsync(project, zone, resource, zoneSetLabelsRequestResource); + lro::Operation response = await disksClient.SetLabelsAsync(project, zone, resource, zoneSetLabelsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await disksClient.PollOnceSetLabelsAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ExternalVpnGatewaysClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ExternalVpnGatewaysClientSnippets.g.cs index c7087401ce9d..bee86774d4fb 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ExternalVpnGatewaysClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ExternalVpnGatewaysClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedExternalVpnGatewaysClientSnippets @@ -38,7 +39,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = externalVpnGatewaysClient.Delete(request); + lro::Operation response = externalVpnGatewaysClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = externalVpnGatewaysClient.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 } @@ -57,7 +74,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await externalVpnGatewaysClient.DeleteAsync(request); + lro::Operation response = await externalVpnGatewaysClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await externalVpnGatewaysClient.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 } @@ -71,7 +104,23 @@ public void Delete() string project = ""; string externalVpnGateway = ""; // Make the request - Operation response = externalVpnGatewaysClient.Delete(project, externalVpnGateway); + lro::Operation response = externalVpnGatewaysClient.Delete(project, externalVpnGateway); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = externalVpnGatewaysClient.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 } @@ -86,7 +135,23 @@ public async Task DeleteAsync() string project = ""; string externalVpnGateway = ""; // Make the request - Operation response = await externalVpnGatewaysClient.DeleteAsync(project, externalVpnGateway); + lro::Operation response = await externalVpnGatewaysClient.DeleteAsync(project, externalVpnGateway); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await externalVpnGatewaysClient.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 } @@ -168,7 +233,23 @@ public void InsertRequestObject() ExternalVpnGatewayResource = new ExternalVpnGateway(), }; // Make the request - Operation response = externalVpnGatewaysClient.Insert(request); + lro::Operation response = externalVpnGatewaysClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = externalVpnGatewaysClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -187,7 +268,23 @@ public async Task InsertRequestObjectAsync() ExternalVpnGatewayResource = new ExternalVpnGateway(), }; // Make the request - Operation response = await externalVpnGatewaysClient.InsertAsync(request); + lro::Operation response = await externalVpnGatewaysClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await externalVpnGatewaysClient.PollOnceInsertAsync(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 } @@ -201,7 +298,23 @@ public void Insert() string project = ""; ExternalVpnGateway externalVpnGatewayResource = new ExternalVpnGateway(); // Make the request - Operation response = externalVpnGatewaysClient.Insert(project, externalVpnGatewayResource); + lro::Operation response = externalVpnGatewaysClient.Insert(project, externalVpnGatewayResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = externalVpnGatewaysClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -216,7 +329,23 @@ public async Task InsertAsync() string project = ""; ExternalVpnGateway externalVpnGatewayResource = new ExternalVpnGateway(); // Make the request - Operation response = await externalVpnGatewaysClient.InsertAsync(project, externalVpnGatewayResource); + lro::Operation response = await externalVpnGatewaysClient.InsertAsync(project, externalVpnGatewayResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await externalVpnGatewaysClient.PollOnceInsertAsync(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 } @@ -426,7 +555,23 @@ public void SetLabelsRequestObject() GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), }; // Make the request - Operation response = externalVpnGatewaysClient.SetLabels(request); + lro::Operation response = externalVpnGatewaysClient.SetLabels(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = externalVpnGatewaysClient.PollOnceSetLabels(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -445,7 +590,23 @@ public async Task SetLabelsRequestObjectAsync() GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), }; // Make the request - Operation response = await externalVpnGatewaysClient.SetLabelsAsync(request); + lro::Operation response = await externalVpnGatewaysClient.SetLabelsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await externalVpnGatewaysClient.PollOnceSetLabelsAsync(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 } @@ -460,7 +621,23 @@ public void SetLabels() string resource = ""; GlobalSetLabelsRequest globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); // Make the request - Operation response = externalVpnGatewaysClient.SetLabels(project, resource, globalSetLabelsRequestResource); + lro::Operation response = externalVpnGatewaysClient.SetLabels(project, resource, globalSetLabelsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = externalVpnGatewaysClient.PollOnceSetLabels(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -476,7 +653,23 @@ public async Task SetLabelsAsync() string resource = ""; GlobalSetLabelsRequest globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); // Make the request - Operation response = await externalVpnGatewaysClient.SetLabelsAsync(project, resource, globalSetLabelsRequestResource); + lro::Operation response = await externalVpnGatewaysClient.SetLabelsAsync(project, resource, globalSetLabelsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await externalVpnGatewaysClient.PollOnceSetLabelsAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/FirewallPoliciesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/FirewallPoliciesClientSnippets.g.cs index 68719a0c3696..4bac32f22fd2 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/FirewallPoliciesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/FirewallPoliciesClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedFirewallPoliciesClientSnippets @@ -39,7 +40,23 @@ public void AddAssociationRequestObject() FirewallPolicy = "", }; // Make the request - Operation response = firewallPoliciesClient.AddAssociation(request); + lro::Operation response = firewallPoliciesClient.AddAssociation(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallPoliciesClient.PollOnceAddAssociation(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 } @@ -59,7 +76,23 @@ public async Task AddAssociationRequestObjectAsync() FirewallPolicy = "", }; // Make the request - Operation response = await firewallPoliciesClient.AddAssociationAsync(request); + lro::Operation response = await firewallPoliciesClient.AddAssociationAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallPoliciesClient.PollOnceAddAssociationAsync(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 } @@ -73,7 +106,23 @@ public void AddAssociation() string firewallPolicy = ""; FirewallPolicyAssociation firewallPolicyAssociationResource = new FirewallPolicyAssociation(); // Make the request - Operation response = firewallPoliciesClient.AddAssociation(firewallPolicy, firewallPolicyAssociationResource); + lro::Operation response = firewallPoliciesClient.AddAssociation(firewallPolicy, firewallPolicyAssociationResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallPoliciesClient.PollOnceAddAssociation(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 } @@ -88,7 +137,23 @@ public async Task AddAssociationAsync() string firewallPolicy = ""; FirewallPolicyAssociation firewallPolicyAssociationResource = new FirewallPolicyAssociation(); // Make the request - Operation response = await firewallPoliciesClient.AddAssociationAsync(firewallPolicy, firewallPolicyAssociationResource); + lro::Operation response = await firewallPoliciesClient.AddAssociationAsync(firewallPolicy, firewallPolicyAssociationResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallPoliciesClient.PollOnceAddAssociationAsync(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 } @@ -106,7 +171,23 @@ public void AddRuleRequestObject() FirewallPolicy = "", }; // Make the request - Operation response = firewallPoliciesClient.AddRule(request); + lro::Operation response = firewallPoliciesClient.AddRule(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallPoliciesClient.PollOnceAddRule(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 } @@ -125,7 +206,23 @@ public async Task AddRuleRequestObjectAsync() FirewallPolicy = "", }; // Make the request - Operation response = await firewallPoliciesClient.AddRuleAsync(request); + lro::Operation response = await firewallPoliciesClient.AddRuleAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallPoliciesClient.PollOnceAddRuleAsync(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 } @@ -139,7 +236,23 @@ public void AddRule() string firewallPolicy = ""; FirewallPolicyRule firewallPolicyRuleResource = new FirewallPolicyRule(); // Make the request - Operation response = firewallPoliciesClient.AddRule(firewallPolicy, firewallPolicyRuleResource); + lro::Operation response = firewallPoliciesClient.AddRule(firewallPolicy, firewallPolicyRuleResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallPoliciesClient.PollOnceAddRule(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 } @@ -154,7 +267,23 @@ public async Task AddRuleAsync() string firewallPolicy = ""; FirewallPolicyRule firewallPolicyRuleResource = new FirewallPolicyRule(); // Make the request - Operation response = await firewallPoliciesClient.AddRuleAsync(firewallPolicy, firewallPolicyRuleResource); + lro::Operation response = await firewallPoliciesClient.AddRuleAsync(firewallPolicy, firewallPolicyRuleResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallPoliciesClient.PollOnceAddRuleAsync(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 } @@ -172,7 +301,23 @@ public void CloneRulesRequestObject() FirewallPolicy = "", }; // Make the request - Operation response = firewallPoliciesClient.CloneRules(request); + lro::Operation response = firewallPoliciesClient.CloneRules(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallPoliciesClient.PollOnceCloneRules(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 } @@ -191,7 +336,23 @@ public async Task CloneRulesRequestObjectAsync() FirewallPolicy = "", }; // Make the request - Operation response = await firewallPoliciesClient.CloneRulesAsync(request); + lro::Operation response = await firewallPoliciesClient.CloneRulesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallPoliciesClient.PollOnceCloneRulesAsync(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 } @@ -204,7 +365,23 @@ public void CloneRules() // Initialize request argument(s) string firewallPolicy = ""; // Make the request - Operation response = firewallPoliciesClient.CloneRules(firewallPolicy); + lro::Operation response = firewallPoliciesClient.CloneRules(firewallPolicy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallPoliciesClient.PollOnceCloneRules(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 } @@ -218,7 +395,23 @@ public async Task CloneRulesAsync() // Initialize request argument(s) string firewallPolicy = ""; // Make the request - Operation response = await firewallPoliciesClient.CloneRulesAsync(firewallPolicy); + lro::Operation response = await firewallPoliciesClient.CloneRulesAsync(firewallPolicy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallPoliciesClient.PollOnceCloneRulesAsync(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 } @@ -235,7 +428,23 @@ public void DeleteRequestObject() FirewallPolicy = "", }; // Make the request - Operation response = firewallPoliciesClient.Delete(request); + lro::Operation response = firewallPoliciesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallPoliciesClient.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 } @@ -253,7 +462,23 @@ public async Task DeleteRequestObjectAsync() FirewallPolicy = "", }; // Make the request - Operation response = await firewallPoliciesClient.DeleteAsync(request); + lro::Operation response = await firewallPoliciesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallPoliciesClient.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 } @@ -266,7 +491,23 @@ public void Delete() // Initialize request argument(s) string firewallPolicy = ""; // Make the request - Operation response = firewallPoliciesClient.Delete(firewallPolicy); + lro::Operation response = firewallPoliciesClient.Delete(firewallPolicy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallPoliciesClient.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 } @@ -280,7 +521,23 @@ public async Task DeleteAsync() // Initialize request argument(s) string firewallPolicy = ""; // Make the request - Operation response = await firewallPoliciesClient.DeleteAsync(firewallPolicy); + lro::Operation response = await firewallPoliciesClient.DeleteAsync(firewallPolicy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallPoliciesClient.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 } @@ -538,7 +795,23 @@ public void InsertRequestObject() FirewallPolicyResource = new FirewallPolicy(), }; // Make the request - Operation response = firewallPoliciesClient.Insert(request); + lro::Operation response = firewallPoliciesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallPoliciesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -557,7 +830,23 @@ public async Task InsertRequestObjectAsync() FirewallPolicyResource = new FirewallPolicy(), }; // Make the request - Operation response = await firewallPoliciesClient.InsertAsync(request); + lro::Operation response = await firewallPoliciesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallPoliciesClient.PollOnceInsertAsync(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 } @@ -570,7 +859,23 @@ public void Insert() // Initialize request argument(s) FirewallPolicy firewallPolicyResource = new FirewallPolicy(); // Make the request - Operation response = firewallPoliciesClient.Insert(firewallPolicyResource); + lro::Operation response = firewallPoliciesClient.Insert(firewallPolicyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallPoliciesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -584,7 +889,23 @@ public async Task InsertAsync() // Initialize request argument(s) FirewallPolicy firewallPolicyResource = new FirewallPolicy(); // Make the request - Operation response = await firewallPoliciesClient.InsertAsync(firewallPolicyResource); + lro::Operation response = await firewallPoliciesClient.InsertAsync(firewallPolicyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallPoliciesClient.PollOnceInsertAsync(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 } @@ -840,7 +1161,23 @@ public void MoveRequestObject() FirewallPolicy = "", }; // Make the request - Operation response = firewallPoliciesClient.Move(request); + lro::Operation response = firewallPoliciesClient.Move(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallPoliciesClient.PollOnceMove(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 } @@ -859,7 +1196,23 @@ public async Task MoveRequestObjectAsync() FirewallPolicy = "", }; // Make the request - Operation response = await firewallPoliciesClient.MoveAsync(request); + lro::Operation response = await firewallPoliciesClient.MoveAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallPoliciesClient.PollOnceMoveAsync(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 } @@ -872,7 +1225,23 @@ public void Move() // Initialize request argument(s) string firewallPolicy = ""; // Make the request - Operation response = firewallPoliciesClient.Move(firewallPolicy); + lro::Operation response = firewallPoliciesClient.Move(firewallPolicy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallPoliciesClient.PollOnceMove(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 } @@ -886,7 +1255,23 @@ public async Task MoveAsync() // Initialize request argument(s) string firewallPolicy = ""; // Make the request - Operation response = await firewallPoliciesClient.MoveAsync(firewallPolicy); + lro::Operation response = await firewallPoliciesClient.MoveAsync(firewallPolicy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallPoliciesClient.PollOnceMoveAsync(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 } @@ -904,7 +1289,23 @@ public void PatchRequestObject() FirewallPolicy = "", }; // Make the request - Operation response = firewallPoliciesClient.Patch(request); + lro::Operation response = firewallPoliciesClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallPoliciesClient.PollOncePatch(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 } @@ -923,7 +1324,23 @@ public async Task PatchRequestObjectAsync() FirewallPolicy = "", }; // Make the request - Operation response = await firewallPoliciesClient.PatchAsync(request); + lro::Operation response = await firewallPoliciesClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallPoliciesClient.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 } @@ -937,7 +1354,23 @@ public void Patch() string firewallPolicy = ""; FirewallPolicy firewallPolicyResource = new FirewallPolicy(); // Make the request - Operation response = firewallPoliciesClient.Patch(firewallPolicy, firewallPolicyResource); + lro::Operation response = firewallPoliciesClient.Patch(firewallPolicy, firewallPolicyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallPoliciesClient.PollOncePatch(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 } @@ -952,7 +1385,23 @@ public async Task PatchAsync() string firewallPolicy = ""; FirewallPolicy firewallPolicyResource = new FirewallPolicy(); // Make the request - Operation response = await firewallPoliciesClient.PatchAsync(firewallPolicy, firewallPolicyResource); + lro::Operation response = await firewallPoliciesClient.PatchAsync(firewallPolicy, firewallPolicyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallPoliciesClient.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 } @@ -971,7 +1420,23 @@ public void PatchRuleRequestObject() FirewallPolicy = "", }; // Make the request - Operation response = firewallPoliciesClient.PatchRule(request); + lro::Operation response = firewallPoliciesClient.PatchRule(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallPoliciesClient.PollOncePatchRule(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 } @@ -991,7 +1456,23 @@ public async Task PatchRuleRequestObjectAsync() FirewallPolicy = "", }; // Make the request - Operation response = await firewallPoliciesClient.PatchRuleAsync(request); + lro::Operation response = await firewallPoliciesClient.PatchRuleAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallPoliciesClient.PollOncePatchRuleAsync(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 } @@ -1005,7 +1486,23 @@ public void PatchRule() string firewallPolicy = ""; FirewallPolicyRule firewallPolicyRuleResource = new FirewallPolicyRule(); // Make the request - Operation response = firewallPoliciesClient.PatchRule(firewallPolicy, firewallPolicyRuleResource); + lro::Operation response = firewallPoliciesClient.PatchRule(firewallPolicy, firewallPolicyRuleResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallPoliciesClient.PollOncePatchRule(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 } @@ -1020,7 +1517,23 @@ public async Task PatchRuleAsync() string firewallPolicy = ""; FirewallPolicyRule firewallPolicyRuleResource = new FirewallPolicyRule(); // Make the request - Operation response = await firewallPoliciesClient.PatchRuleAsync(firewallPolicy, firewallPolicyRuleResource); + lro::Operation response = await firewallPoliciesClient.PatchRuleAsync(firewallPolicy, firewallPolicyRuleResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallPoliciesClient.PollOncePatchRuleAsync(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 } @@ -1038,7 +1551,23 @@ public void RemoveAssociationRequestObject() FirewallPolicy = "", }; // Make the request - Operation response = firewallPoliciesClient.RemoveAssociation(request); + lro::Operation response = firewallPoliciesClient.RemoveAssociation(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallPoliciesClient.PollOnceRemoveAssociation(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 } @@ -1057,7 +1586,23 @@ public async Task RemoveAssociationRequestObjectAsync() FirewallPolicy = "", }; // Make the request - Operation response = await firewallPoliciesClient.RemoveAssociationAsync(request); + lro::Operation response = await firewallPoliciesClient.RemoveAssociationAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallPoliciesClient.PollOnceRemoveAssociationAsync(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 } @@ -1070,7 +1615,23 @@ public void RemoveAssociation() // Initialize request argument(s) string firewallPolicy = ""; // Make the request - Operation response = firewallPoliciesClient.RemoveAssociation(firewallPolicy); + lro::Operation response = firewallPoliciesClient.RemoveAssociation(firewallPolicy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallPoliciesClient.PollOnceRemoveAssociation(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 } @@ -1084,7 +1645,23 @@ public async Task RemoveAssociationAsync() // Initialize request argument(s) string firewallPolicy = ""; // Make the request - Operation response = await firewallPoliciesClient.RemoveAssociationAsync(firewallPolicy); + lro::Operation response = await firewallPoliciesClient.RemoveAssociationAsync(firewallPolicy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallPoliciesClient.PollOnceRemoveAssociationAsync(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 } @@ -1102,7 +1679,23 @@ public void RemoveRuleRequestObject() FirewallPolicy = "", }; // Make the request - Operation response = firewallPoliciesClient.RemoveRule(request); + lro::Operation response = firewallPoliciesClient.RemoveRule(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallPoliciesClient.PollOnceRemoveRule(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 } @@ -1121,7 +1714,23 @@ public async Task RemoveRuleRequestObjectAsync() FirewallPolicy = "", }; // Make the request - Operation response = await firewallPoliciesClient.RemoveRuleAsync(request); + lro::Operation response = await firewallPoliciesClient.RemoveRuleAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallPoliciesClient.PollOnceRemoveRuleAsync(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 } @@ -1134,7 +1743,23 @@ public void RemoveRule() // Initialize request argument(s) string firewallPolicy = ""; // Make the request - Operation response = firewallPoliciesClient.RemoveRule(firewallPolicy); + lro::Operation response = firewallPoliciesClient.RemoveRule(firewallPolicy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallPoliciesClient.PollOnceRemoveRule(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 } @@ -1148,7 +1773,23 @@ public async Task RemoveRuleAsync() // Initialize request argument(s) string firewallPolicy = ""; // Make the request - Operation response = await firewallPoliciesClient.RemoveRuleAsync(firewallPolicy); + lro::Operation response = await firewallPoliciesClient.RemoveRuleAsync(firewallPolicy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallPoliciesClient.PollOnceRemoveRuleAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/FirewallsClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/FirewallsClientSnippets.g.cs index a6be8527cdc0..0fe0cb940cc8 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/FirewallsClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/FirewallsClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedFirewallsClientSnippets @@ -38,7 +39,23 @@ public void DeleteRequestObject() Firewall = "", }; // Make the request - Operation response = firewallsClient.Delete(request); + lro::Operation response = firewallsClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallsClient.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 } @@ -57,7 +74,23 @@ public async Task DeleteRequestObjectAsync() Firewall = "", }; // Make the request - Operation response = await firewallsClient.DeleteAsync(request); + lro::Operation response = await firewallsClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallsClient.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 } @@ -71,7 +104,23 @@ public void Delete() string project = ""; string firewall = ""; // Make the request - Operation response = firewallsClient.Delete(project, firewall); + lro::Operation response = firewallsClient.Delete(project, firewall); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallsClient.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 } @@ -86,7 +135,23 @@ public async Task DeleteAsync() string project = ""; string firewall = ""; // Make the request - Operation response = await firewallsClient.DeleteAsync(project, firewall); + lro::Operation response = await firewallsClient.DeleteAsync(project, firewall); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallsClient.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 } @@ -168,7 +233,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = firewallsClient.Insert(request); + lro::Operation response = firewallsClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -187,7 +268,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await firewallsClient.InsertAsync(request); + lro::Operation response = await firewallsClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallsClient.PollOnceInsertAsync(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 } @@ -201,7 +298,23 @@ public void Insert() string project = ""; Firewall firewallResource = new Firewall(); // Make the request - Operation response = firewallsClient.Insert(project, firewallResource); + lro::Operation response = firewallsClient.Insert(project, firewallResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -216,7 +329,23 @@ public async Task InsertAsync() string project = ""; Firewall firewallResource = new Firewall(); // Make the request - Operation response = await firewallsClient.InsertAsync(project, firewallResource); + lro::Operation response = await firewallsClient.InsertAsync(project, firewallResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallsClient.PollOnceInsertAsync(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 } @@ -427,7 +556,23 @@ public void PatchRequestObject() Firewall = "", }; // Make the request - Operation response = firewallsClient.Patch(request); + lro::Operation response = firewallsClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallsClient.PollOncePatch(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 } @@ -447,7 +592,23 @@ public async Task PatchRequestObjectAsync() Firewall = "", }; // Make the request - Operation response = await firewallsClient.PatchAsync(request); + lro::Operation response = await firewallsClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallsClient.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 } @@ -462,7 +623,23 @@ public void Patch() string firewall = ""; Firewall firewallResource = new Firewall(); // Make the request - Operation response = firewallsClient.Patch(project, firewall, firewallResource); + lro::Operation response = firewallsClient.Patch(project, firewall, firewallResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallsClient.PollOncePatch(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 } @@ -478,7 +655,23 @@ public async Task PatchAsync() string firewall = ""; Firewall firewallResource = new Firewall(); // Make the request - Operation response = await firewallsClient.PatchAsync(project, firewall, firewallResource); + lro::Operation response = await firewallsClient.PatchAsync(project, firewall, firewallResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallsClient.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 } @@ -497,7 +690,23 @@ public void UpdateRequestObject() Firewall = "", }; // Make the request - Operation response = firewallsClient.Update(request); + lro::Operation response = firewallsClient.Update(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallsClient.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 } @@ -517,7 +726,23 @@ public async Task UpdateRequestObjectAsync() Firewall = "", }; // Make the request - Operation response = await firewallsClient.UpdateAsync(request); + lro::Operation response = await firewallsClient.UpdateAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallsClient.PollOnceUpdateAsync(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 } @@ -532,7 +757,23 @@ public void Update() string firewall = ""; Firewall firewallResource = new Firewall(); // Make the request - Operation response = firewallsClient.Update(project, firewall, firewallResource); + lro::Operation response = firewallsClient.Update(project, firewall, firewallResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = firewallsClient.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 } @@ -548,7 +789,23 @@ public async Task UpdateAsync() string firewall = ""; Firewall firewallResource = new Firewall(); // Make the request - Operation response = await firewallsClient.UpdateAsync(project, firewall, firewallResource); + lro::Operation response = await firewallsClient.UpdateAsync(project, firewall, firewallResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await firewallsClient.PollOnceUpdateAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ForwardingRulesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ForwardingRulesClientSnippets.g.cs index bab00986feac..928e3685fde5 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ForwardingRulesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ForwardingRulesClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedForwardingRulesClientSnippets @@ -234,7 +235,23 @@ public void DeleteRequestObject() ForwardingRule = "", }; // Make the request - Operation response = forwardingRulesClient.Delete(request); + lro::Operation response = forwardingRulesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = forwardingRulesClient.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 } @@ -254,7 +271,23 @@ public async Task DeleteRequestObjectAsync() ForwardingRule = "", }; // Make the request - Operation response = await forwardingRulesClient.DeleteAsync(request); + lro::Operation response = await forwardingRulesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await forwardingRulesClient.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 } @@ -269,7 +302,23 @@ public void Delete() string region = ""; string forwardingRule = ""; // Make the request - Operation response = forwardingRulesClient.Delete(project, region, forwardingRule); + lro::Operation response = forwardingRulesClient.Delete(project, region, forwardingRule); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = forwardingRulesClient.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 } @@ -285,7 +334,23 @@ public async Task DeleteAsync() string region = ""; string forwardingRule = ""; // Make the request - Operation response = await forwardingRulesClient.DeleteAsync(project, region, forwardingRule); + lro::Operation response = await forwardingRulesClient.DeleteAsync(project, region, forwardingRule); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await forwardingRulesClient.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 } @@ -372,7 +437,23 @@ public void InsertRequestObject() ForwardingRuleResource = new ForwardingRule(), }; // Make the request - Operation response = forwardingRulesClient.Insert(request); + lro::Operation response = forwardingRulesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = forwardingRulesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -392,7 +473,23 @@ public async Task InsertRequestObjectAsync() ForwardingRuleResource = new ForwardingRule(), }; // Make the request - Operation response = await forwardingRulesClient.InsertAsync(request); + lro::Operation response = await forwardingRulesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await forwardingRulesClient.PollOnceInsertAsync(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 } @@ -407,7 +504,23 @@ public void Insert() string region = ""; ForwardingRule forwardingRuleResource = new ForwardingRule(); // Make the request - Operation response = forwardingRulesClient.Insert(project, region, forwardingRuleResource); + lro::Operation response = forwardingRulesClient.Insert(project, region, forwardingRuleResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = forwardingRulesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -423,7 +536,23 @@ public async Task InsertAsync() string region = ""; ForwardingRule forwardingRuleResource = new ForwardingRule(); // Make the request - Operation response = await forwardingRulesClient.InsertAsync(project, region, forwardingRuleResource); + lro::Operation response = await forwardingRulesClient.InsertAsync(project, region, forwardingRuleResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await forwardingRulesClient.PollOnceInsertAsync(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 } @@ -639,7 +768,23 @@ public void PatchRequestObject() ForwardingRuleResource = new ForwardingRule(), }; // Make the request - Operation response = forwardingRulesClient.Patch(request); + lro::Operation response = forwardingRulesClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = forwardingRulesClient.PollOncePatch(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 } @@ -660,7 +805,23 @@ public async Task PatchRequestObjectAsync() ForwardingRuleResource = new ForwardingRule(), }; // Make the request - Operation response = await forwardingRulesClient.PatchAsync(request); + lro::Operation response = await forwardingRulesClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await forwardingRulesClient.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 } @@ -676,7 +837,23 @@ public void Patch() string forwardingRule = ""; ForwardingRule forwardingRuleResource = new ForwardingRule(); // Make the request - Operation response = forwardingRulesClient.Patch(project, region, forwardingRule, forwardingRuleResource); + lro::Operation response = forwardingRulesClient.Patch(project, region, forwardingRule, forwardingRuleResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = forwardingRulesClient.PollOncePatch(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 } @@ -693,7 +870,23 @@ public async Task PatchAsync() string forwardingRule = ""; ForwardingRule forwardingRuleResource = new ForwardingRule(); // Make the request - Operation response = await forwardingRulesClient.PatchAsync(project, region, forwardingRule, forwardingRuleResource); + lro::Operation response = await forwardingRulesClient.PatchAsync(project, region, forwardingRule, forwardingRuleResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await forwardingRulesClient.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 } @@ -713,7 +906,23 @@ public void SetLabelsRequestObject() RegionSetLabelsRequestResource = new RegionSetLabelsRequest(), }; // Make the request - Operation response = forwardingRulesClient.SetLabels(request); + lro::Operation response = forwardingRulesClient.SetLabels(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = forwardingRulesClient.PollOnceSetLabels(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -734,7 +943,23 @@ public async Task SetLabelsRequestObjectAsync() RegionSetLabelsRequestResource = new RegionSetLabelsRequest(), }; // Make the request - Operation response = await forwardingRulesClient.SetLabelsAsync(request); + lro::Operation response = await forwardingRulesClient.SetLabelsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await forwardingRulesClient.PollOnceSetLabelsAsync(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 } @@ -750,7 +975,23 @@ public void SetLabels() string resource = ""; RegionSetLabelsRequest regionSetLabelsRequestResource = new RegionSetLabelsRequest(); // Make the request - Operation response = forwardingRulesClient.SetLabels(project, region, resource, regionSetLabelsRequestResource); + lro::Operation response = forwardingRulesClient.SetLabels(project, region, resource, regionSetLabelsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = forwardingRulesClient.PollOnceSetLabels(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -767,7 +1008,23 @@ public async Task SetLabelsAsync() string resource = ""; RegionSetLabelsRequest regionSetLabelsRequestResource = new RegionSetLabelsRequest(); // Make the request - Operation response = await forwardingRulesClient.SetLabelsAsync(project, region, resource, regionSetLabelsRequestResource); + lro::Operation response = await forwardingRulesClient.SetLabelsAsync(project, region, resource, regionSetLabelsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await forwardingRulesClient.PollOnceSetLabelsAsync(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 } @@ -787,7 +1044,23 @@ public void SetTargetRequestObject() TargetReferenceResource = new TargetReference(), }; // Make the request - Operation response = forwardingRulesClient.SetTarget(request); + lro::Operation response = forwardingRulesClient.SetTarget(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = forwardingRulesClient.PollOnceSetTarget(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 } @@ -808,7 +1081,23 @@ public async Task SetTargetRequestObjectAsync() TargetReferenceResource = new TargetReference(), }; // Make the request - Operation response = await forwardingRulesClient.SetTargetAsync(request); + lro::Operation response = await forwardingRulesClient.SetTargetAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await forwardingRulesClient.PollOnceSetTargetAsync(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 } @@ -824,7 +1113,23 @@ public void SetTarget() string forwardingRule = ""; TargetReference targetReferenceResource = new TargetReference(); // Make the request - Operation response = forwardingRulesClient.SetTarget(project, region, forwardingRule, targetReferenceResource); + lro::Operation response = forwardingRulesClient.SetTarget(project, region, forwardingRule, targetReferenceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = forwardingRulesClient.PollOnceSetTarget(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 } @@ -841,7 +1146,23 @@ public async Task SetTargetAsync() string forwardingRule = ""; TargetReference targetReferenceResource = new TargetReference(); // Make the request - Operation response = await forwardingRulesClient.SetTargetAsync(project, region, forwardingRule, targetReferenceResource); + lro::Operation response = await forwardingRulesClient.SetTargetAsync(project, region, forwardingRule, targetReferenceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await forwardingRulesClient.PollOnceSetTargetAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/GlobalAddressesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/GlobalAddressesClientSnippets.g.cs index 520ea1ab2b96..b5a4d8b53384 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/GlobalAddressesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/GlobalAddressesClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedGlobalAddressesClientSnippets @@ -38,7 +39,23 @@ public void DeleteRequestObject() Address = "", }; // Make the request - Operation response = globalAddressesClient.Delete(request); + lro::Operation response = globalAddressesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalAddressesClient.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 } @@ -57,7 +74,23 @@ public async Task DeleteRequestObjectAsync() Address = "", }; // Make the request - Operation response = await globalAddressesClient.DeleteAsync(request); + lro::Operation response = await globalAddressesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalAddressesClient.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 } @@ -71,7 +104,23 @@ public void Delete() string project = ""; string address = ""; // Make the request - Operation response = globalAddressesClient.Delete(project, address); + lro::Operation response = globalAddressesClient.Delete(project, address); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalAddressesClient.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 } @@ -86,7 +135,23 @@ public async Task DeleteAsync() string project = ""; string address = ""; // Make the request - Operation response = await globalAddressesClient.DeleteAsync(project, address); + lro::Operation response = await globalAddressesClient.DeleteAsync(project, address); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalAddressesClient.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 } @@ -168,7 +233,23 @@ public void InsertRequestObject() AddressResource = new Address(), }; // Make the request - Operation response = globalAddressesClient.Insert(request); + lro::Operation response = globalAddressesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalAddressesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -187,7 +268,23 @@ public async Task InsertRequestObjectAsync() AddressResource = new Address(), }; // Make the request - Operation response = await globalAddressesClient.InsertAsync(request); + lro::Operation response = await globalAddressesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalAddressesClient.PollOnceInsertAsync(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 } @@ -201,7 +298,23 @@ public void Insert() string project = ""; Address addressResource = new Address(); // Make the request - Operation response = globalAddressesClient.Insert(project, addressResource); + lro::Operation response = globalAddressesClient.Insert(project, addressResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalAddressesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -216,7 +329,23 @@ public async Task InsertAsync() string project = ""; Address addressResource = new Address(); // Make the request - Operation response = await globalAddressesClient.InsertAsync(project, addressResource); + lro::Operation response = await globalAddressesClient.InsertAsync(project, addressResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalAddressesClient.PollOnceInsertAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/GlobalForwardingRulesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/GlobalForwardingRulesClientSnippets.g.cs index bf3bedcbe60e..f46df495384c 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/GlobalForwardingRulesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/GlobalForwardingRulesClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedGlobalForwardingRulesClientSnippets @@ -38,7 +39,23 @@ public void DeleteRequestObject() ForwardingRule = "", }; // Make the request - Operation response = globalForwardingRulesClient.Delete(request); + lro::Operation response = globalForwardingRulesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalForwardingRulesClient.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 } @@ -57,7 +74,23 @@ public async Task DeleteRequestObjectAsync() ForwardingRule = "", }; // Make the request - Operation response = await globalForwardingRulesClient.DeleteAsync(request); + lro::Operation response = await globalForwardingRulesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalForwardingRulesClient.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 } @@ -71,7 +104,23 @@ public void Delete() string project = ""; string forwardingRule = ""; // Make the request - Operation response = globalForwardingRulesClient.Delete(project, forwardingRule); + lro::Operation response = globalForwardingRulesClient.Delete(project, forwardingRule); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalForwardingRulesClient.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 } @@ -86,7 +135,23 @@ public async Task DeleteAsync() string project = ""; string forwardingRule = ""; // Make the request - Operation response = await globalForwardingRulesClient.DeleteAsync(project, forwardingRule); + lro::Operation response = await globalForwardingRulesClient.DeleteAsync(project, forwardingRule); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalForwardingRulesClient.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 } @@ -168,7 +233,23 @@ public void InsertRequestObject() ForwardingRuleResource = new ForwardingRule(), }; // Make the request - Operation response = globalForwardingRulesClient.Insert(request); + lro::Operation response = globalForwardingRulesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalForwardingRulesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -187,7 +268,23 @@ public async Task InsertRequestObjectAsync() ForwardingRuleResource = new ForwardingRule(), }; // Make the request - Operation response = await globalForwardingRulesClient.InsertAsync(request); + lro::Operation response = await globalForwardingRulesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalForwardingRulesClient.PollOnceInsertAsync(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 } @@ -201,7 +298,23 @@ public void Insert() string project = ""; ForwardingRule forwardingRuleResource = new ForwardingRule(); // Make the request - Operation response = globalForwardingRulesClient.Insert(project, forwardingRuleResource); + lro::Operation response = globalForwardingRulesClient.Insert(project, forwardingRuleResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalForwardingRulesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -216,7 +329,23 @@ public async Task InsertAsync() string project = ""; ForwardingRule forwardingRuleResource = new ForwardingRule(); // Make the request - Operation response = await globalForwardingRulesClient.InsertAsync(project, forwardingRuleResource); + lro::Operation response = await globalForwardingRulesClient.InsertAsync(project, forwardingRuleResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalForwardingRulesClient.PollOnceInsertAsync(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 } @@ -427,7 +556,23 @@ public void PatchRequestObject() ForwardingRuleResource = new ForwardingRule(), }; // Make the request - Operation response = globalForwardingRulesClient.Patch(request); + lro::Operation response = globalForwardingRulesClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalForwardingRulesClient.PollOncePatch(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 } @@ -447,7 +592,23 @@ public async Task PatchRequestObjectAsync() ForwardingRuleResource = new ForwardingRule(), }; // Make the request - Operation response = await globalForwardingRulesClient.PatchAsync(request); + lro::Operation response = await globalForwardingRulesClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalForwardingRulesClient.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 } @@ -462,7 +623,23 @@ public void Patch() string forwardingRule = ""; ForwardingRule forwardingRuleResource = new ForwardingRule(); // Make the request - Operation response = globalForwardingRulesClient.Patch(project, forwardingRule, forwardingRuleResource); + lro::Operation response = globalForwardingRulesClient.Patch(project, forwardingRule, forwardingRuleResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalForwardingRulesClient.PollOncePatch(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 } @@ -478,7 +655,23 @@ public async Task PatchAsync() string forwardingRule = ""; ForwardingRule forwardingRuleResource = new ForwardingRule(); // Make the request - Operation response = await globalForwardingRulesClient.PatchAsync(project, forwardingRule, forwardingRuleResource); + lro::Operation response = await globalForwardingRulesClient.PatchAsync(project, forwardingRule, forwardingRuleResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalForwardingRulesClient.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 } @@ -496,7 +689,23 @@ public void SetLabelsRequestObject() GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), }; // Make the request - Operation response = globalForwardingRulesClient.SetLabels(request); + lro::Operation response = globalForwardingRulesClient.SetLabels(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalForwardingRulesClient.PollOnceSetLabels(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -515,7 +724,23 @@ public async Task SetLabelsRequestObjectAsync() GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), }; // Make the request - Operation response = await globalForwardingRulesClient.SetLabelsAsync(request); + lro::Operation response = await globalForwardingRulesClient.SetLabelsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalForwardingRulesClient.PollOnceSetLabelsAsync(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 } @@ -530,7 +755,23 @@ public void SetLabels() string resource = ""; GlobalSetLabelsRequest globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); // Make the request - Operation response = globalForwardingRulesClient.SetLabels(project, resource, globalSetLabelsRequestResource); + lro::Operation response = globalForwardingRulesClient.SetLabels(project, resource, globalSetLabelsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalForwardingRulesClient.PollOnceSetLabels(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -546,7 +787,23 @@ public async Task SetLabelsAsync() string resource = ""; GlobalSetLabelsRequest globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); // Make the request - Operation response = await globalForwardingRulesClient.SetLabelsAsync(project, resource, globalSetLabelsRequestResource); + lro::Operation response = await globalForwardingRulesClient.SetLabelsAsync(project, resource, globalSetLabelsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalForwardingRulesClient.PollOnceSetLabelsAsync(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 } @@ -565,7 +822,23 @@ public void SetTargetRequestObject() TargetReferenceResource = new TargetReference(), }; // Make the request - Operation response = globalForwardingRulesClient.SetTarget(request); + lro::Operation response = globalForwardingRulesClient.SetTarget(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalForwardingRulesClient.PollOnceSetTarget(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 } @@ -585,7 +858,23 @@ public async Task SetTargetRequestObjectAsync() TargetReferenceResource = new TargetReference(), }; // Make the request - Operation response = await globalForwardingRulesClient.SetTargetAsync(request); + lro::Operation response = await globalForwardingRulesClient.SetTargetAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalForwardingRulesClient.PollOnceSetTargetAsync(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 } @@ -600,7 +889,23 @@ public void SetTarget() string forwardingRule = ""; TargetReference targetReferenceResource = new TargetReference(); // Make the request - Operation response = globalForwardingRulesClient.SetTarget(project, forwardingRule, targetReferenceResource); + lro::Operation response = globalForwardingRulesClient.SetTarget(project, forwardingRule, targetReferenceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalForwardingRulesClient.PollOnceSetTarget(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 } @@ -616,7 +921,23 @@ public async Task SetTargetAsync() string forwardingRule = ""; TargetReference targetReferenceResource = new TargetReference(); // Make the request - Operation response = await globalForwardingRulesClient.SetTargetAsync(project, forwardingRule, targetReferenceResource); + lro::Operation response = await globalForwardingRulesClient.SetTargetAsync(project, forwardingRule, targetReferenceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalForwardingRulesClient.PollOnceSetTargetAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/GlobalNetworkEndpointGroupsClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/GlobalNetworkEndpointGroupsClientSnippets.g.cs index c8f73125176b..dde5c3b7b21e 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/GlobalNetworkEndpointGroupsClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/GlobalNetworkEndpointGroupsClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedGlobalNetworkEndpointGroupsClientSnippets @@ -39,7 +40,23 @@ public void AttachNetworkEndpointsRequestObject() NetworkEndpointGroup = "", }; // Make the request - Operation response = globalNetworkEndpointGroupsClient.AttachNetworkEndpoints(request); + lro::Operation response = globalNetworkEndpointGroupsClient.AttachNetworkEndpoints(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalNetworkEndpointGroupsClient.PollOnceAttachNetworkEndpoints(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 } @@ -59,7 +76,23 @@ public async Task AttachNetworkEndpointsRequestObjectAsync() NetworkEndpointGroup = "", }; // Make the request - Operation response = await globalNetworkEndpointGroupsClient.AttachNetworkEndpointsAsync(request); + lro::Operation response = await globalNetworkEndpointGroupsClient.AttachNetworkEndpointsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalNetworkEndpointGroupsClient.PollOnceAttachNetworkEndpointsAsync(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 } @@ -74,7 +107,23 @@ public void AttachNetworkEndpoints() string networkEndpointGroup = ""; GlobalNetworkEndpointGroupsAttachEndpointsRequest globalNetworkEndpointGroupsAttachEndpointsRequestResource = new GlobalNetworkEndpointGroupsAttachEndpointsRequest(); // Make the request - Operation response = globalNetworkEndpointGroupsClient.AttachNetworkEndpoints(project, networkEndpointGroup, globalNetworkEndpointGroupsAttachEndpointsRequestResource); + lro::Operation response = globalNetworkEndpointGroupsClient.AttachNetworkEndpoints(project, networkEndpointGroup, globalNetworkEndpointGroupsAttachEndpointsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalNetworkEndpointGroupsClient.PollOnceAttachNetworkEndpoints(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 } @@ -90,7 +139,23 @@ public async Task AttachNetworkEndpointsAsync() string networkEndpointGroup = ""; GlobalNetworkEndpointGroupsAttachEndpointsRequest globalNetworkEndpointGroupsAttachEndpointsRequestResource = new GlobalNetworkEndpointGroupsAttachEndpointsRequest(); // Make the request - Operation response = await globalNetworkEndpointGroupsClient.AttachNetworkEndpointsAsync(project, networkEndpointGroup, globalNetworkEndpointGroupsAttachEndpointsRequestResource); + lro::Operation response = await globalNetworkEndpointGroupsClient.AttachNetworkEndpointsAsync(project, networkEndpointGroup, globalNetworkEndpointGroupsAttachEndpointsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalNetworkEndpointGroupsClient.PollOnceAttachNetworkEndpointsAsync(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 } @@ -108,7 +173,23 @@ public void DeleteRequestObject() NetworkEndpointGroup = "", }; // Make the request - Operation response = globalNetworkEndpointGroupsClient.Delete(request); + lro::Operation response = globalNetworkEndpointGroupsClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalNetworkEndpointGroupsClient.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 } @@ -127,7 +208,23 @@ public async Task DeleteRequestObjectAsync() NetworkEndpointGroup = "", }; // Make the request - Operation response = await globalNetworkEndpointGroupsClient.DeleteAsync(request); + lro::Operation response = await globalNetworkEndpointGroupsClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalNetworkEndpointGroupsClient.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 } @@ -141,7 +238,23 @@ public void Delete() string project = ""; string networkEndpointGroup = ""; // Make the request - Operation response = globalNetworkEndpointGroupsClient.Delete(project, networkEndpointGroup); + lro::Operation response = globalNetworkEndpointGroupsClient.Delete(project, networkEndpointGroup); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalNetworkEndpointGroupsClient.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 } @@ -156,7 +269,23 @@ public async Task DeleteAsync() string project = ""; string networkEndpointGroup = ""; // Make the request - Operation response = await globalNetworkEndpointGroupsClient.DeleteAsync(project, networkEndpointGroup); + lro::Operation response = await globalNetworkEndpointGroupsClient.DeleteAsync(project, networkEndpointGroup); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalNetworkEndpointGroupsClient.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 } @@ -175,7 +304,23 @@ public void DetachNetworkEndpointsRequestObject() NetworkEndpointGroup = "", }; // Make the request - Operation response = globalNetworkEndpointGroupsClient.DetachNetworkEndpoints(request); + lro::Operation response = globalNetworkEndpointGroupsClient.DetachNetworkEndpoints(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalNetworkEndpointGroupsClient.PollOnceDetachNetworkEndpoints(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 } @@ -195,7 +340,23 @@ public async Task DetachNetworkEndpointsRequestObjectAsync() NetworkEndpointGroup = "", }; // Make the request - Operation response = await globalNetworkEndpointGroupsClient.DetachNetworkEndpointsAsync(request); + lro::Operation response = await globalNetworkEndpointGroupsClient.DetachNetworkEndpointsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalNetworkEndpointGroupsClient.PollOnceDetachNetworkEndpointsAsync(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 } @@ -210,7 +371,23 @@ public void DetachNetworkEndpoints() string networkEndpointGroup = ""; GlobalNetworkEndpointGroupsDetachEndpointsRequest globalNetworkEndpointGroupsDetachEndpointsRequestResource = new GlobalNetworkEndpointGroupsDetachEndpointsRequest(); // Make the request - Operation response = globalNetworkEndpointGroupsClient.DetachNetworkEndpoints(project, networkEndpointGroup, globalNetworkEndpointGroupsDetachEndpointsRequestResource); + lro::Operation response = globalNetworkEndpointGroupsClient.DetachNetworkEndpoints(project, networkEndpointGroup, globalNetworkEndpointGroupsDetachEndpointsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalNetworkEndpointGroupsClient.PollOnceDetachNetworkEndpoints(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 } @@ -226,7 +403,23 @@ public async Task DetachNetworkEndpointsAsync() string networkEndpointGroup = ""; GlobalNetworkEndpointGroupsDetachEndpointsRequest globalNetworkEndpointGroupsDetachEndpointsRequestResource = new GlobalNetworkEndpointGroupsDetachEndpointsRequest(); // Make the request - Operation response = await globalNetworkEndpointGroupsClient.DetachNetworkEndpointsAsync(project, networkEndpointGroup, globalNetworkEndpointGroupsDetachEndpointsRequestResource); + lro::Operation response = await globalNetworkEndpointGroupsClient.DetachNetworkEndpointsAsync(project, networkEndpointGroup, globalNetworkEndpointGroupsDetachEndpointsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalNetworkEndpointGroupsClient.PollOnceDetachNetworkEndpointsAsync(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 } @@ -308,7 +501,23 @@ public void InsertRequestObject() NetworkEndpointGroupResource = new NetworkEndpointGroup(), }; // Make the request - Operation response = globalNetworkEndpointGroupsClient.Insert(request); + lro::Operation response = globalNetworkEndpointGroupsClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalNetworkEndpointGroupsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -327,7 +536,23 @@ public async Task InsertRequestObjectAsync() NetworkEndpointGroupResource = new NetworkEndpointGroup(), }; // Make the request - Operation response = await globalNetworkEndpointGroupsClient.InsertAsync(request); + lro::Operation response = await globalNetworkEndpointGroupsClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalNetworkEndpointGroupsClient.PollOnceInsertAsync(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 } @@ -341,7 +566,23 @@ public void Insert() string project = ""; NetworkEndpointGroup networkEndpointGroupResource = new NetworkEndpointGroup(); // Make the request - Operation response = globalNetworkEndpointGroupsClient.Insert(project, networkEndpointGroupResource); + lro::Operation response = globalNetworkEndpointGroupsClient.Insert(project, networkEndpointGroupResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalNetworkEndpointGroupsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -356,7 +597,23 @@ public async Task InsertAsync() string project = ""; NetworkEndpointGroup networkEndpointGroupResource = new NetworkEndpointGroup(); // Make the request - Operation response = await globalNetworkEndpointGroupsClient.InsertAsync(project, networkEndpointGroupResource); + lro::Operation response = await globalNetworkEndpointGroupsClient.InsertAsync(project, networkEndpointGroupResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalNetworkEndpointGroupsClient.PollOnceInsertAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/GlobalPublicDelegatedPrefixesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/GlobalPublicDelegatedPrefixesClientSnippets.g.cs index a3645dcd6d99..3a9d7c1602a9 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/GlobalPublicDelegatedPrefixesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/GlobalPublicDelegatedPrefixesClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedGlobalPublicDelegatedPrefixesClientSnippets @@ -38,7 +39,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = globalPublicDelegatedPrefixesClient.Delete(request); + lro::Operation response = globalPublicDelegatedPrefixesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalPublicDelegatedPrefixesClient.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 } @@ -57,7 +74,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await globalPublicDelegatedPrefixesClient.DeleteAsync(request); + lro::Operation response = await globalPublicDelegatedPrefixesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalPublicDelegatedPrefixesClient.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 } @@ -71,7 +104,23 @@ public void Delete() string project = ""; string publicDelegatedPrefix = ""; // Make the request - Operation response = globalPublicDelegatedPrefixesClient.Delete(project, publicDelegatedPrefix); + lro::Operation response = globalPublicDelegatedPrefixesClient.Delete(project, publicDelegatedPrefix); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalPublicDelegatedPrefixesClient.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 } @@ -86,7 +135,23 @@ public async Task DeleteAsync() string project = ""; string publicDelegatedPrefix = ""; // Make the request - Operation response = await globalPublicDelegatedPrefixesClient.DeleteAsync(project, publicDelegatedPrefix); + lro::Operation response = await globalPublicDelegatedPrefixesClient.DeleteAsync(project, publicDelegatedPrefix); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalPublicDelegatedPrefixesClient.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 } @@ -168,7 +233,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = globalPublicDelegatedPrefixesClient.Insert(request); + lro::Operation response = globalPublicDelegatedPrefixesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalPublicDelegatedPrefixesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -187,7 +268,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await globalPublicDelegatedPrefixesClient.InsertAsync(request); + lro::Operation response = await globalPublicDelegatedPrefixesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalPublicDelegatedPrefixesClient.PollOnceInsertAsync(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 } @@ -201,7 +298,23 @@ public void Insert() string project = ""; PublicDelegatedPrefix publicDelegatedPrefixResource = new PublicDelegatedPrefix(); // Make the request - Operation response = globalPublicDelegatedPrefixesClient.Insert(project, publicDelegatedPrefixResource); + lro::Operation response = globalPublicDelegatedPrefixesClient.Insert(project, publicDelegatedPrefixResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalPublicDelegatedPrefixesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -216,7 +329,23 @@ public async Task InsertAsync() string project = ""; PublicDelegatedPrefix publicDelegatedPrefixResource = new PublicDelegatedPrefix(); // Make the request - Operation response = await globalPublicDelegatedPrefixesClient.InsertAsync(project, publicDelegatedPrefixResource); + lro::Operation response = await globalPublicDelegatedPrefixesClient.InsertAsync(project, publicDelegatedPrefixResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalPublicDelegatedPrefixesClient.PollOnceInsertAsync(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 } @@ -427,7 +556,23 @@ public void PatchRequestObject() Project = "", }; // Make the request - Operation response = globalPublicDelegatedPrefixesClient.Patch(request); + lro::Operation response = globalPublicDelegatedPrefixesClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalPublicDelegatedPrefixesClient.PollOncePatch(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 } @@ -447,7 +592,23 @@ public async Task PatchRequestObjectAsync() Project = "", }; // Make the request - Operation response = await globalPublicDelegatedPrefixesClient.PatchAsync(request); + lro::Operation response = await globalPublicDelegatedPrefixesClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalPublicDelegatedPrefixesClient.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 } @@ -462,7 +623,23 @@ public void Patch() string publicDelegatedPrefix = ""; PublicDelegatedPrefix publicDelegatedPrefixResource = new PublicDelegatedPrefix(); // Make the request - Operation response = globalPublicDelegatedPrefixesClient.Patch(project, publicDelegatedPrefix, publicDelegatedPrefixResource); + lro::Operation response = globalPublicDelegatedPrefixesClient.Patch(project, publicDelegatedPrefix, publicDelegatedPrefixResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = globalPublicDelegatedPrefixesClient.PollOncePatch(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 } @@ -478,7 +655,23 @@ public async Task PatchAsync() string publicDelegatedPrefix = ""; PublicDelegatedPrefix publicDelegatedPrefixResource = new PublicDelegatedPrefix(); // Make the request - Operation response = await globalPublicDelegatedPrefixesClient.PatchAsync(project, publicDelegatedPrefix, publicDelegatedPrefixResource); + lro::Operation response = await globalPublicDelegatedPrefixesClient.PatchAsync(project, publicDelegatedPrefix, publicDelegatedPrefixResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await globalPublicDelegatedPrefixesClient.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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/HealthChecksClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/HealthChecksClientSnippets.g.cs index 3e7e8e1e2596..737ccff5f147 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/HealthChecksClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/HealthChecksClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedHealthChecksClientSnippets @@ -233,7 +234,23 @@ public void DeleteRequestObject() HealthCheck = "", }; // Make the request - Operation response = healthChecksClient.Delete(request); + lro::Operation response = healthChecksClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = healthChecksClient.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 } @@ -252,7 +269,23 @@ public async Task DeleteRequestObjectAsync() HealthCheck = "", }; // Make the request - Operation response = await healthChecksClient.DeleteAsync(request); + lro::Operation response = await healthChecksClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await healthChecksClient.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 } @@ -266,7 +299,23 @@ public void Delete() string project = ""; string healthCheck = ""; // Make the request - Operation response = healthChecksClient.Delete(project, healthCheck); + lro::Operation response = healthChecksClient.Delete(project, healthCheck); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = healthChecksClient.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 } @@ -281,7 +330,23 @@ public async Task DeleteAsync() string project = ""; string healthCheck = ""; // Make the request - Operation response = await healthChecksClient.DeleteAsync(project, healthCheck); + lro::Operation response = await healthChecksClient.DeleteAsync(project, healthCheck); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await healthChecksClient.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 } @@ -363,7 +428,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = healthChecksClient.Insert(request); + lro::Operation response = healthChecksClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = healthChecksClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -382,7 +463,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await healthChecksClient.InsertAsync(request); + lro::Operation response = await healthChecksClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await healthChecksClient.PollOnceInsertAsync(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 } @@ -396,7 +493,23 @@ public void Insert() string project = ""; HealthCheck healthCheckResource = new HealthCheck(); // Make the request - Operation response = healthChecksClient.Insert(project, healthCheckResource); + lro::Operation response = healthChecksClient.Insert(project, healthCheckResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = healthChecksClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -411,7 +524,23 @@ public async Task InsertAsync() string project = ""; HealthCheck healthCheckResource = new HealthCheck(); // Make the request - Operation response = await healthChecksClient.InsertAsync(project, healthCheckResource); + lro::Operation response = await healthChecksClient.InsertAsync(project, healthCheckResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await healthChecksClient.PollOnceInsertAsync(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 } @@ -622,7 +751,23 @@ public void PatchRequestObject() HealthCheck = "", }; // Make the request - Operation response = healthChecksClient.Patch(request); + lro::Operation response = healthChecksClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = healthChecksClient.PollOncePatch(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 } @@ -642,7 +787,23 @@ public async Task PatchRequestObjectAsync() HealthCheck = "", }; // Make the request - Operation response = await healthChecksClient.PatchAsync(request); + lro::Operation response = await healthChecksClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await healthChecksClient.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 } @@ -657,7 +818,23 @@ public void Patch() string healthCheck = ""; HealthCheck healthCheckResource = new HealthCheck(); // Make the request - Operation response = healthChecksClient.Patch(project, healthCheck, healthCheckResource); + lro::Operation response = healthChecksClient.Patch(project, healthCheck, healthCheckResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = healthChecksClient.PollOncePatch(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 } @@ -673,7 +850,23 @@ public async Task PatchAsync() string healthCheck = ""; HealthCheck healthCheckResource = new HealthCheck(); // Make the request - Operation response = await healthChecksClient.PatchAsync(project, healthCheck, healthCheckResource); + lro::Operation response = await healthChecksClient.PatchAsync(project, healthCheck, healthCheckResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await healthChecksClient.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 } @@ -692,7 +885,23 @@ public void UpdateRequestObject() HealthCheck = "", }; // Make the request - Operation response = healthChecksClient.Update(request); + lro::Operation response = healthChecksClient.Update(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = healthChecksClient.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 } @@ -712,7 +921,23 @@ public async Task UpdateRequestObjectAsync() HealthCheck = "", }; // Make the request - Operation response = await healthChecksClient.UpdateAsync(request); + lro::Operation response = await healthChecksClient.UpdateAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await healthChecksClient.PollOnceUpdateAsync(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 } @@ -727,7 +952,23 @@ public void Update() string healthCheck = ""; HealthCheck healthCheckResource = new HealthCheck(); // Make the request - Operation response = healthChecksClient.Update(project, healthCheck, healthCheckResource); + lro::Operation response = healthChecksClient.Update(project, healthCheck, healthCheckResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = healthChecksClient.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 } @@ -743,7 +984,23 @@ public async Task UpdateAsync() string healthCheck = ""; HealthCheck healthCheckResource = new HealthCheck(); // Make the request - Operation response = await healthChecksClient.UpdateAsync(project, healthCheck, healthCheckResource); + lro::Operation response = await healthChecksClient.UpdateAsync(project, healthCheck, healthCheckResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await healthChecksClient.PollOnceUpdateAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ImagesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ImagesClientSnippets.g.cs index 6fc2cab1fd45..c795f75bcae9 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ImagesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ImagesClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedImagesClientSnippets @@ -38,7 +39,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = imagesClient.Delete(request); + lro::Operation response = imagesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = imagesClient.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 } @@ -57,7 +74,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await imagesClient.DeleteAsync(request); + lro::Operation response = await imagesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await imagesClient.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 } @@ -71,7 +104,23 @@ public void Delete() string project = ""; string image = ""; // Make the request - Operation response = imagesClient.Delete(project, image); + lro::Operation response = imagesClient.Delete(project, image); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = imagesClient.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 } @@ -86,7 +135,23 @@ public async Task DeleteAsync() string project = ""; string image = ""; // Make the request - Operation response = await imagesClient.DeleteAsync(project, image); + lro::Operation response = await imagesClient.DeleteAsync(project, image); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await imagesClient.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 } @@ -105,7 +170,23 @@ public void DeprecateRequestObject() DeprecationStatusResource = new DeprecationStatus(), }; // Make the request - Operation response = imagesClient.Deprecate(request); + lro::Operation response = imagesClient.Deprecate(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = imagesClient.PollOnceDeprecate(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 } @@ -125,7 +206,23 @@ public async Task DeprecateRequestObjectAsync() DeprecationStatusResource = new DeprecationStatus(), }; // Make the request - Operation response = await imagesClient.DeprecateAsync(request); + lro::Operation response = await imagesClient.DeprecateAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await imagesClient.PollOnceDeprecateAsync(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 } @@ -140,7 +237,23 @@ public void Deprecate() string image = ""; DeprecationStatus deprecationStatusResource = new DeprecationStatus(); // Make the request - Operation response = imagesClient.Deprecate(project, image, deprecationStatusResource); + lro::Operation response = imagesClient.Deprecate(project, image, deprecationStatusResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = imagesClient.PollOnceDeprecate(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 } @@ -156,7 +269,23 @@ public async Task DeprecateAsync() string image = ""; DeprecationStatus deprecationStatusResource = new DeprecationStatus(); // Make the request - Operation response = await imagesClient.DeprecateAsync(project, image, deprecationStatusResource); + lro::Operation response = await imagesClient.DeprecateAsync(project, image, deprecationStatusResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await imagesClient.PollOnceDeprecateAsync(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 } @@ -369,7 +498,23 @@ public void InsertRequestObject() ImageResource = new Image(), }; // Make the request - Operation response = imagesClient.Insert(request); + lro::Operation response = imagesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = imagesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -389,7 +534,23 @@ public async Task InsertRequestObjectAsync() ImageResource = new Image(), }; // Make the request - Operation response = await imagesClient.InsertAsync(request); + lro::Operation response = await imagesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await imagesClient.PollOnceInsertAsync(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 } @@ -403,7 +564,23 @@ public void Insert() string project = ""; Image imageResource = new Image(); // Make the request - Operation response = imagesClient.Insert(project, imageResource); + lro::Operation response = imagesClient.Insert(project, imageResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = imagesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -418,7 +595,23 @@ public async Task InsertAsync() string project = ""; Image imageResource = new Image(); // Make the request - Operation response = await imagesClient.InsertAsync(project, imageResource); + lro::Operation response = await imagesClient.InsertAsync(project, imageResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await imagesClient.PollOnceInsertAsync(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 } @@ -629,7 +822,23 @@ public void PatchRequestObject() ImageResource = new Image(), }; // Make the request - Operation response = imagesClient.Patch(request); + lro::Operation response = imagesClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = imagesClient.PollOncePatch(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 } @@ -649,7 +858,23 @@ public async Task PatchRequestObjectAsync() ImageResource = new Image(), }; // Make the request - Operation response = await imagesClient.PatchAsync(request); + lro::Operation response = await imagesClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await imagesClient.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 } @@ -664,7 +889,23 @@ public void Patch() string image = ""; Image imageResource = new Image(); // Make the request - Operation response = imagesClient.Patch(project, image, imageResource); + lro::Operation response = imagesClient.Patch(project, image, imageResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = imagesClient.PollOncePatch(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 } @@ -680,7 +921,23 @@ public async Task PatchAsync() string image = ""; Image imageResource = new Image(); // Make the request - Operation response = await imagesClient.PatchAsync(project, image, imageResource); + lro::Operation response = await imagesClient.PatchAsync(project, image, imageResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await imagesClient.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 } @@ -766,7 +1023,23 @@ public void SetLabelsRequestObject() GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), }; // Make the request - Operation response = imagesClient.SetLabels(request); + lro::Operation response = imagesClient.SetLabels(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = imagesClient.PollOnceSetLabels(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -785,7 +1058,23 @@ public async Task SetLabelsRequestObjectAsync() GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), }; // Make the request - Operation response = await imagesClient.SetLabelsAsync(request); + lro::Operation response = await imagesClient.SetLabelsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await imagesClient.PollOnceSetLabelsAsync(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 } @@ -800,7 +1089,23 @@ public void SetLabels() string resource = ""; GlobalSetLabelsRequest globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); // Make the request - Operation response = imagesClient.SetLabels(project, resource, globalSetLabelsRequestResource); + lro::Operation response = imagesClient.SetLabels(project, resource, globalSetLabelsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = imagesClient.PollOnceSetLabels(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -816,7 +1121,23 @@ public async Task SetLabelsAsync() string resource = ""; GlobalSetLabelsRequest globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); // Make the request - Operation response = await imagesClient.SetLabelsAsync(project, resource, globalSetLabelsRequestResource); + lro::Operation response = await imagesClient.SetLabelsAsync(project, resource, globalSetLabelsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await imagesClient.PollOnceSetLabelsAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InstanceGroupManagersClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InstanceGroupManagersClientSnippets.g.cs index a717dbc91ed5..b9a78ddc2e6d 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InstanceGroupManagersClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InstanceGroupManagersClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedInstanceGroupManagersClientSnippets @@ -41,7 +42,23 @@ public void AbandonInstancesRequestObject() InstanceGroupManagersAbandonInstancesRequestResource = new InstanceGroupManagersAbandonInstancesRequest(), }; // Make the request - Operation response = instanceGroupManagersClient.AbandonInstances(request); + lro::Operation response = instanceGroupManagersClient.AbandonInstances(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOnceAbandonInstances(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 } @@ -62,7 +79,23 @@ public async Task AbandonInstancesRequestObjectAsync() InstanceGroupManagersAbandonInstancesRequestResource = new InstanceGroupManagersAbandonInstancesRequest(), }; // Make the request - Operation response = await instanceGroupManagersClient.AbandonInstancesAsync(request); + lro::Operation response = await instanceGroupManagersClient.AbandonInstancesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOnceAbandonInstancesAsync(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 } @@ -78,7 +111,23 @@ public void AbandonInstances() string instanceGroupManager = ""; InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = new InstanceGroupManagersAbandonInstancesRequest(); // Make the request - Operation response = instanceGroupManagersClient.AbandonInstances(project, zone, instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource); + lro::Operation response = instanceGroupManagersClient.AbandonInstances(project, zone, instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOnceAbandonInstances(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 } @@ -95,7 +144,23 @@ public async Task AbandonInstancesAsync() string instanceGroupManager = ""; InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource = new InstanceGroupManagersAbandonInstancesRequest(); // Make the request - Operation response = await instanceGroupManagersClient.AbandonInstancesAsync(project, zone, instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource); + lro::Operation response = await instanceGroupManagersClient.AbandonInstancesAsync(project, zone, instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOnceAbandonInstancesAsync(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 } @@ -308,7 +373,23 @@ public void ApplyUpdatesToInstancesRequestObject() InstanceGroupManagersApplyUpdatesRequestResource = new InstanceGroupManagersApplyUpdatesRequest(), }; // Make the request - Operation response = instanceGroupManagersClient.ApplyUpdatesToInstances(request); + lro::Operation response = instanceGroupManagersClient.ApplyUpdatesToInstances(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOnceApplyUpdatesToInstances(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 } @@ -328,7 +409,23 @@ public async Task ApplyUpdatesToInstancesRequestObjectAsync() InstanceGroupManagersApplyUpdatesRequestResource = new InstanceGroupManagersApplyUpdatesRequest(), }; // Make the request - Operation response = await instanceGroupManagersClient.ApplyUpdatesToInstancesAsync(request); + lro::Operation response = await instanceGroupManagersClient.ApplyUpdatesToInstancesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOnceApplyUpdatesToInstancesAsync(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 } @@ -344,7 +441,23 @@ public void ApplyUpdatesToInstances() string instanceGroupManager = ""; InstanceGroupManagersApplyUpdatesRequest instanceGroupManagersApplyUpdatesRequestResource = new InstanceGroupManagersApplyUpdatesRequest(); // Make the request - Operation response = instanceGroupManagersClient.ApplyUpdatesToInstances(project, zone, instanceGroupManager, instanceGroupManagersApplyUpdatesRequestResource); + lro::Operation response = instanceGroupManagersClient.ApplyUpdatesToInstances(project, zone, instanceGroupManager, instanceGroupManagersApplyUpdatesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOnceApplyUpdatesToInstances(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 } @@ -361,7 +474,23 @@ public async Task ApplyUpdatesToInstancesAsync() string instanceGroupManager = ""; InstanceGroupManagersApplyUpdatesRequest instanceGroupManagersApplyUpdatesRequestResource = new InstanceGroupManagersApplyUpdatesRequest(); // Make the request - Operation response = await instanceGroupManagersClient.ApplyUpdatesToInstancesAsync(project, zone, instanceGroupManager, instanceGroupManagersApplyUpdatesRequestResource); + lro::Operation response = await instanceGroupManagersClient.ApplyUpdatesToInstancesAsync(project, zone, instanceGroupManager, instanceGroupManagersApplyUpdatesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOnceApplyUpdatesToInstancesAsync(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 } @@ -381,7 +510,23 @@ public void CreateInstancesRequestObject() InstanceGroupManager = "", }; // Make the request - Operation response = instanceGroupManagersClient.CreateInstances(request); + lro::Operation response = instanceGroupManagersClient.CreateInstances(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOnceCreateInstances(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 } @@ -402,7 +547,23 @@ public async Task CreateInstancesRequestObjectAsync() InstanceGroupManager = "", }; // Make the request - Operation response = await instanceGroupManagersClient.CreateInstancesAsync(request); + lro::Operation response = await instanceGroupManagersClient.CreateInstancesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOnceCreateInstancesAsync(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 } @@ -418,7 +579,23 @@ public void CreateInstances() string instanceGroupManager = ""; InstanceGroupManagersCreateInstancesRequest instanceGroupManagersCreateInstancesRequestResource = new InstanceGroupManagersCreateInstancesRequest(); // Make the request - Operation response = instanceGroupManagersClient.CreateInstances(project, zone, instanceGroupManager, instanceGroupManagersCreateInstancesRequestResource); + lro::Operation response = instanceGroupManagersClient.CreateInstances(project, zone, instanceGroupManager, instanceGroupManagersCreateInstancesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOnceCreateInstances(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 } @@ -435,7 +612,23 @@ public async Task CreateInstancesAsync() string instanceGroupManager = ""; InstanceGroupManagersCreateInstancesRequest instanceGroupManagersCreateInstancesRequestResource = new InstanceGroupManagersCreateInstancesRequest(); // Make the request - Operation response = await instanceGroupManagersClient.CreateInstancesAsync(project, zone, instanceGroupManager, instanceGroupManagersCreateInstancesRequestResource); + lro::Operation response = await instanceGroupManagersClient.CreateInstancesAsync(project, zone, instanceGroupManager, instanceGroupManagersCreateInstancesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOnceCreateInstancesAsync(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 } @@ -454,7 +647,23 @@ public void DeleteRequestObject() InstanceGroupManager = "", }; // Make the request - Operation response = instanceGroupManagersClient.Delete(request); + lro::Operation response = instanceGroupManagersClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.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 } @@ -474,7 +683,23 @@ public async Task DeleteRequestObjectAsync() InstanceGroupManager = "", }; // Make the request - Operation response = await instanceGroupManagersClient.DeleteAsync(request); + lro::Operation response = await instanceGroupManagersClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.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 } @@ -489,7 +714,23 @@ public void Delete() string zone = ""; string instanceGroupManager = ""; // Make the request - Operation response = instanceGroupManagersClient.Delete(project, zone, instanceGroupManager); + lro::Operation response = instanceGroupManagersClient.Delete(project, zone, instanceGroupManager); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.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 } @@ -505,7 +746,23 @@ public async Task DeleteAsync() string zone = ""; string instanceGroupManager = ""; // Make the request - Operation response = await instanceGroupManagersClient.DeleteAsync(project, zone, instanceGroupManager); + lro::Operation response = await instanceGroupManagersClient.DeleteAsync(project, zone, instanceGroupManager); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.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 } @@ -525,7 +782,23 @@ public void DeleteInstancesRequestObject() InstanceGroupManager = "", }; // Make the request - Operation response = instanceGroupManagersClient.DeleteInstances(request); + lro::Operation response = instanceGroupManagersClient.DeleteInstances(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOnceDeleteInstances(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 } @@ -546,7 +819,23 @@ public async Task DeleteInstancesRequestObjectAsync() InstanceGroupManager = "", }; // Make the request - Operation response = await instanceGroupManagersClient.DeleteInstancesAsync(request); + lro::Operation response = await instanceGroupManagersClient.DeleteInstancesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOnceDeleteInstancesAsync(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 } @@ -562,7 +851,23 @@ public void DeleteInstances() string instanceGroupManager = ""; InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = new InstanceGroupManagersDeleteInstancesRequest(); // Make the request - Operation response = instanceGroupManagersClient.DeleteInstances(project, zone, instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource); + lro::Operation response = instanceGroupManagersClient.DeleteInstances(project, zone, instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOnceDeleteInstances(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 } @@ -579,7 +884,23 @@ public async Task DeleteInstancesAsync() string instanceGroupManager = ""; InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource = new InstanceGroupManagersDeleteInstancesRequest(); // Make the request - Operation response = await instanceGroupManagersClient.DeleteInstancesAsync(project, zone, instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource); + lro::Operation response = await instanceGroupManagersClient.DeleteInstancesAsync(project, zone, instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOnceDeleteInstancesAsync(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 } @@ -598,7 +919,23 @@ public void DeletePerInstanceConfigsRequestObject() InstanceGroupManagersDeletePerInstanceConfigsReqResource = new InstanceGroupManagersDeletePerInstanceConfigsReq(), }; // Make the request - Operation response = instanceGroupManagersClient.DeletePerInstanceConfigs(request); + lro::Operation response = instanceGroupManagersClient.DeletePerInstanceConfigs(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOnceDeletePerInstanceConfigs(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 } @@ -618,7 +955,23 @@ public async Task DeletePerInstanceConfigsRequestObjectAsync() InstanceGroupManagersDeletePerInstanceConfigsReqResource = new InstanceGroupManagersDeletePerInstanceConfigsReq(), }; // Make the request - Operation response = await instanceGroupManagersClient.DeletePerInstanceConfigsAsync(request); + lro::Operation response = await instanceGroupManagersClient.DeletePerInstanceConfigsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOnceDeletePerInstanceConfigsAsync(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 } @@ -634,7 +987,23 @@ public void DeletePerInstanceConfigs() string instanceGroupManager = ""; InstanceGroupManagersDeletePerInstanceConfigsReq instanceGroupManagersDeletePerInstanceConfigsReqResource = new InstanceGroupManagersDeletePerInstanceConfigsReq(); // Make the request - Operation response = instanceGroupManagersClient.DeletePerInstanceConfigs(project, zone, instanceGroupManager, instanceGroupManagersDeletePerInstanceConfigsReqResource); + lro::Operation response = instanceGroupManagersClient.DeletePerInstanceConfigs(project, zone, instanceGroupManager, instanceGroupManagersDeletePerInstanceConfigsReqResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOnceDeletePerInstanceConfigs(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 } @@ -651,7 +1020,23 @@ public async Task DeletePerInstanceConfigsAsync() string instanceGroupManager = ""; InstanceGroupManagersDeletePerInstanceConfigsReq instanceGroupManagersDeletePerInstanceConfigsReqResource = new InstanceGroupManagersDeletePerInstanceConfigsReq(); // Make the request - Operation response = await instanceGroupManagersClient.DeletePerInstanceConfigsAsync(project, zone, instanceGroupManager, instanceGroupManagersDeletePerInstanceConfigsReqResource); + lro::Operation response = await instanceGroupManagersClient.DeletePerInstanceConfigsAsync(project, zone, instanceGroupManager, instanceGroupManagersDeletePerInstanceConfigsReqResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOnceDeletePerInstanceConfigsAsync(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 } @@ -738,7 +1123,23 @@ public void InsertRequestObject() InstanceGroupManagerResource = new InstanceGroupManager(), }; // Make the request - Operation response = instanceGroupManagersClient.Insert(request); + lro::Operation response = instanceGroupManagersClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -758,7 +1159,23 @@ public async Task InsertRequestObjectAsync() InstanceGroupManagerResource = new InstanceGroupManager(), }; // Make the request - Operation response = await instanceGroupManagersClient.InsertAsync(request); + lro::Operation response = await instanceGroupManagersClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOnceInsertAsync(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 } @@ -773,7 +1190,23 @@ public void Insert() string zone = ""; InstanceGroupManager instanceGroupManagerResource = new InstanceGroupManager(); // Make the request - Operation response = instanceGroupManagersClient.Insert(project, zone, instanceGroupManagerResource); + lro::Operation response = instanceGroupManagersClient.Insert(project, zone, instanceGroupManagerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -789,7 +1222,23 @@ public async Task InsertAsync() string zone = ""; InstanceGroupManager instanceGroupManagerResource = new InstanceGroupManager(); // Make the request - Operation response = await instanceGroupManagersClient.InsertAsync(project, zone, instanceGroupManagerResource); + lro::Operation response = await instanceGroupManagersClient.InsertAsync(project, zone, instanceGroupManagerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOnceInsertAsync(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 } @@ -1605,7 +2054,23 @@ public void PatchRequestObject() InstanceGroupManagerResource = new InstanceGroupManager(), }; // Make the request - Operation response = instanceGroupManagersClient.Patch(request); + lro::Operation response = instanceGroupManagersClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOncePatch(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 } @@ -1626,7 +2091,23 @@ public async Task PatchRequestObjectAsync() InstanceGroupManagerResource = new InstanceGroupManager(), }; // Make the request - Operation response = await instanceGroupManagersClient.PatchAsync(request); + lro::Operation response = await instanceGroupManagersClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.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 } @@ -1642,7 +2123,23 @@ public void Patch() string instanceGroupManager = ""; InstanceGroupManager instanceGroupManagerResource = new InstanceGroupManager(); // Make the request - Operation response = instanceGroupManagersClient.Patch(project, zone, instanceGroupManager, instanceGroupManagerResource); + lro::Operation response = instanceGroupManagersClient.Patch(project, zone, instanceGroupManager, instanceGroupManagerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOncePatch(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 } @@ -1659,7 +2156,23 @@ public async Task PatchAsync() string instanceGroupManager = ""; InstanceGroupManager instanceGroupManagerResource = new InstanceGroupManager(); // Make the request - Operation response = await instanceGroupManagersClient.PatchAsync(project, zone, instanceGroupManager, instanceGroupManagerResource); + lro::Operation response = await instanceGroupManagersClient.PatchAsync(project, zone, instanceGroupManager, instanceGroupManagerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.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 } @@ -1679,7 +2192,23 @@ public void PatchPerInstanceConfigsRequestObject() InstanceGroupManagersPatchPerInstanceConfigsReqResource = new InstanceGroupManagersPatchPerInstanceConfigsReq(), }; // Make the request - Operation response = instanceGroupManagersClient.PatchPerInstanceConfigs(request); + lro::Operation response = instanceGroupManagersClient.PatchPerInstanceConfigs(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOncePatchPerInstanceConfigs(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 } @@ -1700,7 +2229,23 @@ public async Task PatchPerInstanceConfigsRequestObjectAsync() InstanceGroupManagersPatchPerInstanceConfigsReqResource = new InstanceGroupManagersPatchPerInstanceConfigsReq(), }; // Make the request - Operation response = await instanceGroupManagersClient.PatchPerInstanceConfigsAsync(request); + lro::Operation response = await instanceGroupManagersClient.PatchPerInstanceConfigsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOncePatchPerInstanceConfigsAsync(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 } @@ -1716,7 +2261,23 @@ public void PatchPerInstanceConfigs() string instanceGroupManager = ""; InstanceGroupManagersPatchPerInstanceConfigsReq instanceGroupManagersPatchPerInstanceConfigsReqResource = new InstanceGroupManagersPatchPerInstanceConfigsReq(); // Make the request - Operation response = instanceGroupManagersClient.PatchPerInstanceConfigs(project, zone, instanceGroupManager, instanceGroupManagersPatchPerInstanceConfigsReqResource); + lro::Operation response = instanceGroupManagersClient.PatchPerInstanceConfigs(project, zone, instanceGroupManager, instanceGroupManagersPatchPerInstanceConfigsReqResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOncePatchPerInstanceConfigs(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 } @@ -1733,7 +2294,23 @@ public async Task PatchPerInstanceConfigsAsync() string instanceGroupManager = ""; InstanceGroupManagersPatchPerInstanceConfigsReq instanceGroupManagersPatchPerInstanceConfigsReqResource = new InstanceGroupManagersPatchPerInstanceConfigsReq(); // Make the request - Operation response = await instanceGroupManagersClient.PatchPerInstanceConfigsAsync(project, zone, instanceGroupManager, instanceGroupManagersPatchPerInstanceConfigsReqResource); + lro::Operation response = await instanceGroupManagersClient.PatchPerInstanceConfigsAsync(project, zone, instanceGroupManager, instanceGroupManagersPatchPerInstanceConfigsReqResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOncePatchPerInstanceConfigsAsync(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 } @@ -1753,7 +2330,23 @@ public void RecreateInstancesRequestObject() InstanceGroupManager = "", }; // Make the request - Operation response = instanceGroupManagersClient.RecreateInstances(request); + lro::Operation response = instanceGroupManagersClient.RecreateInstances(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOnceRecreateInstances(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 } @@ -1774,7 +2367,23 @@ public async Task RecreateInstancesRequestObjectAsync() InstanceGroupManager = "", }; // Make the request - Operation response = await instanceGroupManagersClient.RecreateInstancesAsync(request); + lro::Operation response = await instanceGroupManagersClient.RecreateInstancesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOnceRecreateInstancesAsync(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 } @@ -1790,7 +2399,23 @@ public void RecreateInstances() string instanceGroupManager = ""; InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = new InstanceGroupManagersRecreateInstancesRequest(); // Make the request - Operation response = instanceGroupManagersClient.RecreateInstances(project, zone, instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource); + lro::Operation response = instanceGroupManagersClient.RecreateInstances(project, zone, instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOnceRecreateInstances(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 } @@ -1807,7 +2432,23 @@ public async Task RecreateInstancesAsync() string instanceGroupManager = ""; InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource = new InstanceGroupManagersRecreateInstancesRequest(); // Make the request - Operation response = await instanceGroupManagersClient.RecreateInstancesAsync(project, zone, instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource); + lro::Operation response = await instanceGroupManagersClient.RecreateInstancesAsync(project, zone, instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOnceRecreateInstancesAsync(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 } @@ -1827,7 +2468,23 @@ public void ResizeRequestObject() InstanceGroupManager = "", }; // Make the request - Operation response = instanceGroupManagersClient.Resize(request); + lro::Operation response = instanceGroupManagersClient.Resize(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOnceResize(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 } @@ -1848,7 +2505,23 @@ public async Task ResizeRequestObjectAsync() InstanceGroupManager = "", }; // Make the request - Operation response = await instanceGroupManagersClient.ResizeAsync(request); + lro::Operation response = await instanceGroupManagersClient.ResizeAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOnceResizeAsync(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 } @@ -1864,7 +2537,23 @@ public void Resize() string instanceGroupManager = ""; int size = 0; // Make the request - Operation response = instanceGroupManagersClient.Resize(project, zone, instanceGroupManager, size); + lro::Operation response = instanceGroupManagersClient.Resize(project, zone, instanceGroupManager, size); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOnceResize(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 } @@ -1881,7 +2570,23 @@ public async Task ResizeAsync() string instanceGroupManager = ""; int size = 0; // Make the request - Operation response = await instanceGroupManagersClient.ResizeAsync(project, zone, instanceGroupManager, size); + lro::Operation response = await instanceGroupManagersClient.ResizeAsync(project, zone, instanceGroupManager, size); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOnceResizeAsync(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 } @@ -1901,7 +2606,23 @@ public void SetInstanceTemplateRequestObject() InstanceGroupManager = "", }; // Make the request - Operation response = instanceGroupManagersClient.SetInstanceTemplate(request); + lro::Operation response = instanceGroupManagersClient.SetInstanceTemplate(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOnceSetInstanceTemplate(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 } @@ -1922,7 +2643,23 @@ public async Task SetInstanceTemplateRequestObjectAsync() InstanceGroupManager = "", }; // Make the request - Operation response = await instanceGroupManagersClient.SetInstanceTemplateAsync(request); + lro::Operation response = await instanceGroupManagersClient.SetInstanceTemplateAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOnceSetInstanceTemplateAsync(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 } @@ -1938,7 +2675,23 @@ public void SetInstanceTemplate() string instanceGroupManager = ""; InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = new InstanceGroupManagersSetInstanceTemplateRequest(); // Make the request - Operation response = instanceGroupManagersClient.SetInstanceTemplate(project, zone, instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource); + lro::Operation response = instanceGroupManagersClient.SetInstanceTemplate(project, zone, instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOnceSetInstanceTemplate(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 } @@ -1955,7 +2708,23 @@ public async Task SetInstanceTemplateAsync() string instanceGroupManager = ""; InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource = new InstanceGroupManagersSetInstanceTemplateRequest(); // Make the request - Operation response = await instanceGroupManagersClient.SetInstanceTemplateAsync(project, zone, instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource); + lro::Operation response = await instanceGroupManagersClient.SetInstanceTemplateAsync(project, zone, instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOnceSetInstanceTemplateAsync(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 } @@ -1975,7 +2744,23 @@ public void SetTargetPoolsRequestObject() InstanceGroupManagersSetTargetPoolsRequestResource = new InstanceGroupManagersSetTargetPoolsRequest(), }; // Make the request - Operation response = instanceGroupManagersClient.SetTargetPools(request); + lro::Operation response = instanceGroupManagersClient.SetTargetPools(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOnceSetTargetPools(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 } @@ -1996,7 +2781,23 @@ public async Task SetTargetPoolsRequestObjectAsync() InstanceGroupManagersSetTargetPoolsRequestResource = new InstanceGroupManagersSetTargetPoolsRequest(), }; // Make the request - Operation response = await instanceGroupManagersClient.SetTargetPoolsAsync(request); + lro::Operation response = await instanceGroupManagersClient.SetTargetPoolsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOnceSetTargetPoolsAsync(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 } @@ -2012,7 +2813,23 @@ public void SetTargetPools() string instanceGroupManager = ""; InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = new InstanceGroupManagersSetTargetPoolsRequest(); // Make the request - Operation response = instanceGroupManagersClient.SetTargetPools(project, zone, instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource); + lro::Operation response = instanceGroupManagersClient.SetTargetPools(project, zone, instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOnceSetTargetPools(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 } @@ -2029,7 +2846,23 @@ public async Task SetTargetPoolsAsync() string instanceGroupManager = ""; InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource = new InstanceGroupManagersSetTargetPoolsRequest(); // Make the request - Operation response = await instanceGroupManagersClient.SetTargetPoolsAsync(project, zone, instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource); + lro::Operation response = await instanceGroupManagersClient.SetTargetPoolsAsync(project, zone, instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOnceSetTargetPoolsAsync(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 } @@ -2049,7 +2882,23 @@ public void UpdatePerInstanceConfigsRequestObject() InstanceGroupManager = "", }; // Make the request - Operation response = instanceGroupManagersClient.UpdatePerInstanceConfigs(request); + lro::Operation response = instanceGroupManagersClient.UpdatePerInstanceConfigs(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOnceUpdatePerInstanceConfigs(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 } @@ -2070,7 +2919,23 @@ public async Task UpdatePerInstanceConfigsRequestObjectAsync() InstanceGroupManager = "", }; // Make the request - Operation response = await instanceGroupManagersClient.UpdatePerInstanceConfigsAsync(request); + lro::Operation response = await instanceGroupManagersClient.UpdatePerInstanceConfigsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOnceUpdatePerInstanceConfigsAsync(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 } @@ -2086,7 +2951,23 @@ public void UpdatePerInstanceConfigs() string instanceGroupManager = ""; InstanceGroupManagersUpdatePerInstanceConfigsReq instanceGroupManagersUpdatePerInstanceConfigsReqResource = new InstanceGroupManagersUpdatePerInstanceConfigsReq(); // Make the request - Operation response = instanceGroupManagersClient.UpdatePerInstanceConfigs(project, zone, instanceGroupManager, instanceGroupManagersUpdatePerInstanceConfigsReqResource); + lro::Operation response = instanceGroupManagersClient.UpdatePerInstanceConfigs(project, zone, instanceGroupManager, instanceGroupManagersUpdatePerInstanceConfigsReqResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupManagersClient.PollOnceUpdatePerInstanceConfigs(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 } @@ -2103,7 +2984,23 @@ public async Task UpdatePerInstanceConfigsAsync() string instanceGroupManager = ""; InstanceGroupManagersUpdatePerInstanceConfigsReq instanceGroupManagersUpdatePerInstanceConfigsReqResource = new InstanceGroupManagersUpdatePerInstanceConfigsReq(); // Make the request - Operation response = await instanceGroupManagersClient.UpdatePerInstanceConfigsAsync(project, zone, instanceGroupManager, instanceGroupManagersUpdatePerInstanceConfigsReqResource); + lro::Operation response = await instanceGroupManagersClient.UpdatePerInstanceConfigsAsync(project, zone, instanceGroupManager, instanceGroupManagersUpdatePerInstanceConfigsReqResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupManagersClient.PollOnceUpdatePerInstanceConfigsAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InstanceGroupsClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InstanceGroupsClientSnippets.g.cs index e439cb88b553..41b7756b78af 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InstanceGroupsClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InstanceGroupsClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedInstanceGroupsClientSnippets @@ -41,7 +42,23 @@ public void AddInstancesRequestObject() InstanceGroupsAddInstancesRequestResource = new InstanceGroupsAddInstancesRequest(), }; // Make the request - Operation response = instanceGroupsClient.AddInstances(request); + lro::Operation response = instanceGroupsClient.AddInstances(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupsClient.PollOnceAddInstances(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 } @@ -62,7 +79,23 @@ public async Task AddInstancesRequestObjectAsync() InstanceGroupsAddInstancesRequestResource = new InstanceGroupsAddInstancesRequest(), }; // Make the request - Operation response = await instanceGroupsClient.AddInstancesAsync(request); + lro::Operation response = await instanceGroupsClient.AddInstancesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupsClient.PollOnceAddInstancesAsync(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 } @@ -78,7 +111,23 @@ public void AddInstances() string instanceGroup = ""; InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = new InstanceGroupsAddInstancesRequest(); // Make the request - Operation response = instanceGroupsClient.AddInstances(project, zone, instanceGroup, instanceGroupsAddInstancesRequestResource); + lro::Operation response = instanceGroupsClient.AddInstances(project, zone, instanceGroup, instanceGroupsAddInstancesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupsClient.PollOnceAddInstances(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 } @@ -95,7 +144,23 @@ public async Task AddInstancesAsync() string instanceGroup = ""; InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource = new InstanceGroupsAddInstancesRequest(); // Make the request - Operation response = await instanceGroupsClient.AddInstancesAsync(project, zone, instanceGroup, instanceGroupsAddInstancesRequestResource); + lro::Operation response = await instanceGroupsClient.AddInstancesAsync(project, zone, instanceGroup, instanceGroupsAddInstancesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupsClient.PollOnceAddInstancesAsync(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 } @@ -308,7 +373,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = instanceGroupsClient.Delete(request); + lro::Operation response = instanceGroupsClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupsClient.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 } @@ -328,7 +409,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await instanceGroupsClient.DeleteAsync(request); + lro::Operation response = await instanceGroupsClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupsClient.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 } @@ -343,7 +440,23 @@ public void Delete() string zone = ""; string instanceGroup = ""; // Make the request - Operation response = instanceGroupsClient.Delete(project, zone, instanceGroup); + lro::Operation response = instanceGroupsClient.Delete(project, zone, instanceGroup); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupsClient.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 } @@ -359,7 +472,23 @@ public async Task DeleteAsync() string zone = ""; string instanceGroup = ""; // Make the request - Operation response = await instanceGroupsClient.DeleteAsync(project, zone, instanceGroup); + lro::Operation response = await instanceGroupsClient.DeleteAsync(project, zone, instanceGroup); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupsClient.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 } @@ -446,7 +575,23 @@ public void InsertRequestObject() InstanceGroupResource = new InstanceGroup(), }; // Make the request - Operation response = instanceGroupsClient.Insert(request); + lro::Operation response = instanceGroupsClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -466,7 +611,23 @@ public async Task InsertRequestObjectAsync() InstanceGroupResource = new InstanceGroup(), }; // Make the request - Operation response = await instanceGroupsClient.InsertAsync(request); + lro::Operation response = await instanceGroupsClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupsClient.PollOnceInsertAsync(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 } @@ -481,7 +642,23 @@ public void Insert() string zone = ""; InstanceGroup instanceGroupResource = new InstanceGroup(); // Make the request - Operation response = instanceGroupsClient.Insert(project, zone, instanceGroupResource); + lro::Operation response = instanceGroupsClient.Insert(project, zone, instanceGroupResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -497,7 +674,23 @@ public async Task InsertAsync() string zone = ""; InstanceGroup instanceGroupResource = new InstanceGroup(); // Make the request - Operation response = await instanceGroupsClient.InsertAsync(project, zone, instanceGroupResource); + lro::Operation response = await instanceGroupsClient.InsertAsync(project, zone, instanceGroupResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupsClient.PollOnceInsertAsync(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 } @@ -917,7 +1110,23 @@ public void RemoveInstancesRequestObject() InstanceGroupsRemoveInstancesRequestResource = new InstanceGroupsRemoveInstancesRequest(), }; // Make the request - Operation response = instanceGroupsClient.RemoveInstances(request); + lro::Operation response = instanceGroupsClient.RemoveInstances(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupsClient.PollOnceRemoveInstances(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 } @@ -938,7 +1147,23 @@ public async Task RemoveInstancesRequestObjectAsync() InstanceGroupsRemoveInstancesRequestResource = new InstanceGroupsRemoveInstancesRequest(), }; // Make the request - Operation response = await instanceGroupsClient.RemoveInstancesAsync(request); + lro::Operation response = await instanceGroupsClient.RemoveInstancesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupsClient.PollOnceRemoveInstancesAsync(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 } @@ -954,7 +1179,23 @@ public void RemoveInstances() string instanceGroup = ""; InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = new InstanceGroupsRemoveInstancesRequest(); // Make the request - Operation response = instanceGroupsClient.RemoveInstances(project, zone, instanceGroup, instanceGroupsRemoveInstancesRequestResource); + lro::Operation response = instanceGroupsClient.RemoveInstances(project, zone, instanceGroup, instanceGroupsRemoveInstancesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupsClient.PollOnceRemoveInstances(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 } @@ -971,7 +1212,23 @@ public async Task RemoveInstancesAsync() string instanceGroup = ""; InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource = new InstanceGroupsRemoveInstancesRequest(); // Make the request - Operation response = await instanceGroupsClient.RemoveInstancesAsync(project, zone, instanceGroup, instanceGroupsRemoveInstancesRequestResource); + lro::Operation response = await instanceGroupsClient.RemoveInstancesAsync(project, zone, instanceGroup, instanceGroupsRemoveInstancesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupsClient.PollOnceRemoveInstancesAsync(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 } @@ -991,7 +1248,23 @@ public void SetNamedPortsRequestObject() InstanceGroupsSetNamedPortsRequestResource = new InstanceGroupsSetNamedPortsRequest(), }; // Make the request - Operation response = instanceGroupsClient.SetNamedPorts(request); + lro::Operation response = instanceGroupsClient.SetNamedPorts(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupsClient.PollOnceSetNamedPorts(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 } @@ -1012,7 +1285,23 @@ public async Task SetNamedPortsRequestObjectAsync() InstanceGroupsSetNamedPortsRequestResource = new InstanceGroupsSetNamedPortsRequest(), }; // Make the request - Operation response = await instanceGroupsClient.SetNamedPortsAsync(request); + lro::Operation response = await instanceGroupsClient.SetNamedPortsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupsClient.PollOnceSetNamedPortsAsync(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 } @@ -1028,7 +1317,23 @@ public void SetNamedPorts() string instanceGroup = ""; InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = new InstanceGroupsSetNamedPortsRequest(); // Make the request - Operation response = instanceGroupsClient.SetNamedPorts(project, zone, instanceGroup, instanceGroupsSetNamedPortsRequestResource); + lro::Operation response = instanceGroupsClient.SetNamedPorts(project, zone, instanceGroup, instanceGroupsSetNamedPortsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceGroupsClient.PollOnceSetNamedPorts(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 } @@ -1045,7 +1350,23 @@ public async Task SetNamedPortsAsync() string instanceGroup = ""; InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = new InstanceGroupsSetNamedPortsRequest(); // Make the request - Operation response = await instanceGroupsClient.SetNamedPortsAsync(project, zone, instanceGroup, instanceGroupsSetNamedPortsRequestResource); + lro::Operation response = await instanceGroupsClient.SetNamedPortsAsync(project, zone, instanceGroup, instanceGroupsSetNamedPortsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceGroupsClient.PollOnceSetNamedPortsAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InstanceTemplatesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InstanceTemplatesClientSnippets.g.cs index b2693173204e..0c0017812bfd 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InstanceTemplatesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InstanceTemplatesClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedInstanceTemplatesClientSnippets @@ -38,7 +39,23 @@ public void DeleteRequestObject() InstanceTemplate = "", }; // Make the request - Operation response = instanceTemplatesClient.Delete(request); + lro::Operation response = instanceTemplatesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceTemplatesClient.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 } @@ -57,7 +74,23 @@ public async Task DeleteRequestObjectAsync() InstanceTemplate = "", }; // Make the request - Operation response = await instanceTemplatesClient.DeleteAsync(request); + lro::Operation response = await instanceTemplatesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceTemplatesClient.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 } @@ -71,7 +104,23 @@ public void Delete() string project = ""; string instanceTemplate = ""; // Make the request - Operation response = instanceTemplatesClient.Delete(project, instanceTemplate); + lro::Operation response = instanceTemplatesClient.Delete(project, instanceTemplate); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceTemplatesClient.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 } @@ -86,7 +135,23 @@ public async Task DeleteAsync() string project = ""; string instanceTemplate = ""; // Make the request - Operation response = await instanceTemplatesClient.DeleteAsync(project, instanceTemplate); + lro::Operation response = await instanceTemplatesClient.DeleteAsync(project, instanceTemplate); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceTemplatesClient.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 } @@ -234,7 +299,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = instanceTemplatesClient.Insert(request); + lro::Operation response = instanceTemplatesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceTemplatesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -253,7 +334,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await instanceTemplatesClient.InsertAsync(request); + lro::Operation response = await instanceTemplatesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceTemplatesClient.PollOnceInsertAsync(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 } @@ -267,7 +364,23 @@ public void Insert() string project = ""; InstanceTemplate instanceTemplateResource = new InstanceTemplate(); // Make the request - Operation response = instanceTemplatesClient.Insert(project, instanceTemplateResource); + lro::Operation response = instanceTemplatesClient.Insert(project, instanceTemplateResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instanceTemplatesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -282,7 +395,23 @@ public async Task InsertAsync() string project = ""; InstanceTemplate instanceTemplateResource = new InstanceTemplate(); // Make the request - Operation response = await instanceTemplatesClient.InsertAsync(project, instanceTemplateResource); + lro::Operation response = await instanceTemplatesClient.InsertAsync(project, instanceTemplateResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instanceTemplatesClient.PollOnceInsertAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InstancesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InstancesClientSnippets.g.cs index d4c283735074..7b35d9389329 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InstancesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InstancesClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedInstancesClientSnippets @@ -42,7 +43,23 @@ public void AddAccessConfigRequestObject() AccessConfigResource = new AccessConfig(), }; // Make the request - Operation response = instancesClient.AddAccessConfig(request); + lro::Operation response = instancesClient.AddAccessConfig(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceAddAccessConfig(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 } @@ -64,7 +81,23 @@ public async Task AddAccessConfigRequestObjectAsync() AccessConfigResource = new AccessConfig(), }; // Make the request - Operation response = await instancesClient.AddAccessConfigAsync(request); + lro::Operation response = await instancesClient.AddAccessConfigAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceAddAccessConfigAsync(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 } @@ -81,7 +114,23 @@ public void AddAccessConfig() string networkInterface = ""; AccessConfig accessConfigResource = new AccessConfig(); // Make the request - Operation response = instancesClient.AddAccessConfig(project, zone, instance, networkInterface, accessConfigResource); + lro::Operation response = instancesClient.AddAccessConfig(project, zone, instance, networkInterface, accessConfigResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceAddAccessConfig(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 } @@ -99,7 +148,23 @@ public async Task AddAccessConfigAsync() string networkInterface = ""; AccessConfig accessConfigResource = new AccessConfig(); // Make the request - Operation response = await instancesClient.AddAccessConfigAsync(project, zone, instance, networkInterface, accessConfigResource); + lro::Operation response = await instancesClient.AddAccessConfigAsync(project, zone, instance, networkInterface, accessConfigResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceAddAccessConfigAsync(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 } @@ -119,7 +184,23 @@ public void AddResourcePoliciesRequestObject() InstancesAddResourcePoliciesRequestResource = new InstancesAddResourcePoliciesRequest(), }; // Make the request - Operation response = instancesClient.AddResourcePolicies(request); + lro::Operation response = instancesClient.AddResourcePolicies(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceAddResourcePolicies(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 } @@ -140,7 +221,23 @@ public async Task AddResourcePoliciesRequestObjectAsync() InstancesAddResourcePoliciesRequestResource = new InstancesAddResourcePoliciesRequest(), }; // Make the request - Operation response = await instancesClient.AddResourcePoliciesAsync(request); + lro::Operation response = await instancesClient.AddResourcePoliciesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceAddResourcePoliciesAsync(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 } @@ -156,7 +253,23 @@ public void AddResourcePolicies() string instance = ""; InstancesAddResourcePoliciesRequest instancesAddResourcePoliciesRequestResource = new InstancesAddResourcePoliciesRequest(); // Make the request - Operation response = instancesClient.AddResourcePolicies(project, zone, instance, instancesAddResourcePoliciesRequestResource); + lro::Operation response = instancesClient.AddResourcePolicies(project, zone, instance, instancesAddResourcePoliciesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceAddResourcePolicies(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 } @@ -173,7 +286,23 @@ public async Task AddResourcePoliciesAsync() string instance = ""; InstancesAddResourcePoliciesRequest instancesAddResourcePoliciesRequestResource = new InstancesAddResourcePoliciesRequest(); // Make the request - Operation response = await instancesClient.AddResourcePoliciesAsync(project, zone, instance, instancesAddResourcePoliciesRequestResource); + lro::Operation response = await instancesClient.AddResourcePoliciesAsync(project, zone, instance, instancesAddResourcePoliciesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceAddResourcePoliciesAsync(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 } @@ -388,7 +517,23 @@ public void AttachDiskRequestObject() Project = "", }; // Make the request - Operation response = instancesClient.AttachDisk(request); + lro::Operation response = instancesClient.AttachDisk(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceAttachDisk(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 } @@ -410,7 +555,23 @@ public async Task AttachDiskRequestObjectAsync() Project = "", }; // Make the request - Operation response = await instancesClient.AttachDiskAsync(request); + lro::Operation response = await instancesClient.AttachDiskAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceAttachDiskAsync(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 } @@ -426,7 +587,23 @@ public void AttachDisk() string instance = ""; AttachedDisk attachedDiskResource = new AttachedDisk(); // Make the request - Operation response = instancesClient.AttachDisk(project, zone, instance, attachedDiskResource); + lro::Operation response = instancesClient.AttachDisk(project, zone, instance, attachedDiskResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceAttachDisk(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 } @@ -443,7 +620,23 @@ public async Task AttachDiskAsync() string instance = ""; AttachedDisk attachedDiskResource = new AttachedDisk(); // Make the request - Operation response = await instancesClient.AttachDiskAsync(project, zone, instance, attachedDiskResource); + lro::Operation response = await instancesClient.AttachDiskAsync(project, zone, instance, attachedDiskResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceAttachDiskAsync(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 } @@ -462,7 +655,23 @@ public void BulkInsertRequestObject() Project = "", }; // Make the request - Operation response = instancesClient.BulkInsert(request); + lro::Operation response = instancesClient.BulkInsert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceBulkInsert(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 } @@ -482,7 +691,23 @@ public async Task BulkInsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await instancesClient.BulkInsertAsync(request); + lro::Operation response = await instancesClient.BulkInsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceBulkInsertAsync(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 } @@ -497,7 +722,23 @@ public void BulkInsert() string zone = ""; BulkInsertInstanceResource bulkInsertInstanceResourceResource = new BulkInsertInstanceResource(); // Make the request - Operation response = instancesClient.BulkInsert(project, zone, bulkInsertInstanceResourceResource); + lro::Operation response = instancesClient.BulkInsert(project, zone, bulkInsertInstanceResourceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceBulkInsert(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 } @@ -513,7 +754,23 @@ public async Task BulkInsertAsync() string zone = ""; BulkInsertInstanceResource bulkInsertInstanceResourceResource = new BulkInsertInstanceResource(); // Make the request - Operation response = await instancesClient.BulkInsertAsync(project, zone, bulkInsertInstanceResourceResource); + lro::Operation response = await instancesClient.BulkInsertAsync(project, zone, bulkInsertInstanceResourceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceBulkInsertAsync(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 } @@ -532,7 +789,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = instancesClient.Delete(request); + lro::Operation response = instancesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.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 } @@ -552,7 +825,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await instancesClient.DeleteAsync(request); + lro::Operation response = await instancesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.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 } @@ -567,7 +856,23 @@ public void Delete() string zone = ""; string instance = ""; // Make the request - Operation response = instancesClient.Delete(project, zone, instance); + lro::Operation response = instancesClient.Delete(project, zone, instance); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.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 } @@ -583,7 +888,23 @@ public async Task DeleteAsync() string zone = ""; string instance = ""; // Make the request - Operation response = await instancesClient.DeleteAsync(project, zone, instance); + lro::Operation response = await instancesClient.DeleteAsync(project, zone, instance); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.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 } @@ -604,7 +925,23 @@ public void DeleteAccessConfigRequestObject() NetworkInterface = "", }; // Make the request - Operation response = instancesClient.DeleteAccessConfig(request); + lro::Operation response = instancesClient.DeleteAccessConfig(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceDeleteAccessConfig(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 } @@ -626,7 +963,23 @@ public async Task DeleteAccessConfigRequestObjectAsync() NetworkInterface = "", }; // Make the request - Operation response = await instancesClient.DeleteAccessConfigAsync(request); + lro::Operation response = await instancesClient.DeleteAccessConfigAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceDeleteAccessConfigAsync(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 } @@ -643,7 +996,23 @@ public void DeleteAccessConfig() string accessConfig = ""; string networkInterface = ""; // Make the request - Operation response = instancesClient.DeleteAccessConfig(project, zone, instance, accessConfig, networkInterface); + lro::Operation response = instancesClient.DeleteAccessConfig(project, zone, instance, accessConfig, networkInterface); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceDeleteAccessConfig(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 } @@ -661,7 +1030,23 @@ public async Task DeleteAccessConfigAsync() string accessConfig = ""; string networkInterface = ""; // Make the request - Operation response = await instancesClient.DeleteAccessConfigAsync(project, zone, instance, accessConfig, networkInterface); + lro::Operation response = await instancesClient.DeleteAccessConfigAsync(project, zone, instance, accessConfig, networkInterface); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceDeleteAccessConfigAsync(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 } @@ -681,7 +1066,23 @@ public void DetachDiskRequestObject() Project = "", }; // Make the request - Operation response = instancesClient.DetachDisk(request); + lro::Operation response = instancesClient.DetachDisk(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceDetachDisk(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 } @@ -702,7 +1103,23 @@ public async Task DetachDiskRequestObjectAsync() Project = "", }; // Make the request - Operation response = await instancesClient.DetachDiskAsync(request); + lro::Operation response = await instancesClient.DetachDiskAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceDetachDiskAsync(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 } @@ -718,7 +1135,23 @@ public void DetachDisk() string instance = ""; string deviceName = ""; // Make the request - Operation response = instancesClient.DetachDisk(project, zone, instance, deviceName); + lro::Operation response = instancesClient.DetachDisk(project, zone, instance, deviceName); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceDetachDisk(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 } @@ -735,7 +1168,23 @@ public async Task DetachDiskAsync() string instance = ""; string deviceName = ""; // Make the request - Operation response = await instancesClient.DetachDiskAsync(project, zone, instance, deviceName); + lro::Operation response = await instancesClient.DetachDiskAsync(project, zone, instance, deviceName); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceDetachDiskAsync(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 } @@ -1245,7 +1694,23 @@ public void InsertRequestObject() SourceInstanceTemplate = "", }; // Make the request - Operation response = instancesClient.Insert(request); + lro::Operation response = instancesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -1266,7 +1731,23 @@ public async Task InsertRequestObjectAsync() SourceInstanceTemplate = "", }; // Make the request - Operation response = await instancesClient.InsertAsync(request); + lro::Operation response = await instancesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceInsertAsync(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 } @@ -1281,7 +1762,23 @@ public void Insert() string zone = ""; Instance instanceResource = new Instance(); // Make the request - Operation response = instancesClient.Insert(project, zone, instanceResource); + lro::Operation response = instancesClient.Insert(project, zone, instanceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -1297,7 +1794,23 @@ public async Task InsertAsync() string zone = ""; Instance instanceResource = new Instance(); // Make the request - Operation response = await instancesClient.InsertAsync(project, zone, instanceResource); + lro::Operation response = await instancesClient.InsertAsync(project, zone, instanceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceInsertAsync(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 } @@ -1713,7 +2226,23 @@ public void RemoveResourcePoliciesRequestObject() Project = "", }; // Make the request - Operation response = instancesClient.RemoveResourcePolicies(request); + lro::Operation response = instancesClient.RemoveResourcePolicies(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceRemoveResourcePolicies(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 } @@ -1734,7 +2263,23 @@ public async Task RemoveResourcePoliciesRequestObjectAsync() Project = "", }; // Make the request - Operation response = await instancesClient.RemoveResourcePoliciesAsync(request); + lro::Operation response = await instancesClient.RemoveResourcePoliciesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceRemoveResourcePoliciesAsync(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 } @@ -1750,7 +2295,23 @@ public void RemoveResourcePolicies() string instance = ""; InstancesRemoveResourcePoliciesRequest instancesRemoveResourcePoliciesRequestResource = new InstancesRemoveResourcePoliciesRequest(); // Make the request - Operation response = instancesClient.RemoveResourcePolicies(project, zone, instance, instancesRemoveResourcePoliciesRequestResource); + lro::Operation response = instancesClient.RemoveResourcePolicies(project, zone, instance, instancesRemoveResourcePoliciesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceRemoveResourcePolicies(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 } @@ -1767,7 +2328,23 @@ public async Task RemoveResourcePoliciesAsync() string instance = ""; InstancesRemoveResourcePoliciesRequest instancesRemoveResourcePoliciesRequestResource = new InstancesRemoveResourcePoliciesRequest(); // Make the request - Operation response = await instancesClient.RemoveResourcePoliciesAsync(project, zone, instance, instancesRemoveResourcePoliciesRequestResource); + lro::Operation response = await instancesClient.RemoveResourcePoliciesAsync(project, zone, instance, instancesRemoveResourcePoliciesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceRemoveResourcePoliciesAsync(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 } @@ -1786,7 +2363,23 @@ public void ResetRequestObject() Project = "", }; // Make the request - Operation response = instancesClient.Reset(request); + lro::Operation response = instancesClient.Reset(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceReset(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 } @@ -1806,7 +2399,23 @@ public async Task ResetRequestObjectAsync() Project = "", }; // Make the request - Operation response = await instancesClient.ResetAsync(request); + lro::Operation response = await instancesClient.ResetAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceResetAsync(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 } @@ -1821,7 +2430,23 @@ public void Reset() string zone = ""; string instance = ""; // Make the request - Operation response = instancesClient.Reset(project, zone, instance); + lro::Operation response = instancesClient.Reset(project, zone, instance); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceReset(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 } @@ -1837,7 +2462,23 @@ public async Task ResetAsync() string zone = ""; string instance = ""; // Make the request - Operation response = await instancesClient.ResetAsync(project, zone, instance); + lro::Operation response = await instancesClient.ResetAsync(project, zone, instance); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceResetAsync(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 } @@ -1857,7 +2498,23 @@ public void SetDeletionProtectionRequestObject() DeletionProtection = false, }; // Make the request - Operation response = instancesClient.SetDeletionProtection(request); + lro::Operation response = instancesClient.SetDeletionProtection(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSetDeletionProtection(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 } @@ -1878,7 +2535,23 @@ public async Task SetDeletionProtectionRequestObjectAsync() DeletionProtection = false, }; // Make the request - Operation response = await instancesClient.SetDeletionProtectionAsync(request); + lro::Operation response = await instancesClient.SetDeletionProtectionAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSetDeletionProtectionAsync(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 } @@ -1893,7 +2566,23 @@ public void SetDeletionProtection() string zone = ""; string resource = ""; // Make the request - Operation response = instancesClient.SetDeletionProtection(project, zone, resource); + lro::Operation response = instancesClient.SetDeletionProtection(project, zone, resource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSetDeletionProtection(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 } @@ -1909,7 +2598,23 @@ public async Task SetDeletionProtectionAsync() string zone = ""; string resource = ""; // Make the request - Operation response = await instancesClient.SetDeletionProtectionAsync(project, zone, resource); + lro::Operation response = await instancesClient.SetDeletionProtectionAsync(project, zone, resource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSetDeletionProtectionAsync(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 } @@ -1930,7 +2635,23 @@ public void SetDiskAutoDeleteRequestObject() AutoDelete = false, }; // Make the request - Operation response = instancesClient.SetDiskAutoDelete(request); + lro::Operation response = instancesClient.SetDiskAutoDelete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSetDiskAutoDelete(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 } @@ -1952,7 +2673,23 @@ public async Task SetDiskAutoDeleteRequestObjectAsync() AutoDelete = false, }; // Make the request - Operation response = await instancesClient.SetDiskAutoDeleteAsync(request); + lro::Operation response = await instancesClient.SetDiskAutoDeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSetDiskAutoDeleteAsync(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 } @@ -1969,7 +2706,23 @@ public void SetDiskAutoDelete() bool autoDelete = false; string deviceName = ""; // Make the request - Operation response = instancesClient.SetDiskAutoDelete(project, zone, instance, autoDelete, deviceName); + lro::Operation response = instancesClient.SetDiskAutoDelete(project, zone, instance, autoDelete, deviceName); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSetDiskAutoDelete(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 } @@ -1987,7 +2740,23 @@ public async Task SetDiskAutoDeleteAsync() bool autoDelete = false; string deviceName = ""; // Make the request - Operation response = await instancesClient.SetDiskAutoDeleteAsync(project, zone, instance, autoDelete, deviceName); + lro::Operation response = await instancesClient.SetDiskAutoDeleteAsync(project, zone, instance, autoDelete, deviceName); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSetDiskAutoDeleteAsync(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 } @@ -2079,7 +2848,23 @@ public void SetLabelsRequestObject() Project = "", }; // Make the request - Operation response = instancesClient.SetLabels(request); + lro::Operation response = instancesClient.SetLabels(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSetLabels(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -2100,7 +2885,23 @@ public async Task SetLabelsRequestObjectAsync() Project = "", }; // Make the request - Operation response = await instancesClient.SetLabelsAsync(request); + lro::Operation response = await instancesClient.SetLabelsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSetLabelsAsync(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 } @@ -2116,7 +2917,23 @@ public void SetLabels() string instance = ""; InstancesSetLabelsRequest instancesSetLabelsRequestResource = new InstancesSetLabelsRequest(); // Make the request - Operation response = instancesClient.SetLabels(project, zone, instance, instancesSetLabelsRequestResource); + lro::Operation response = instancesClient.SetLabels(project, zone, instance, instancesSetLabelsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSetLabels(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -2133,7 +2950,23 @@ public async Task SetLabelsAsync() string instance = ""; InstancesSetLabelsRequest instancesSetLabelsRequestResource = new InstancesSetLabelsRequest(); // Make the request - Operation response = await instancesClient.SetLabelsAsync(project, zone, instance, instancesSetLabelsRequestResource); + lro::Operation response = await instancesClient.SetLabelsAsync(project, zone, instance, instancesSetLabelsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSetLabelsAsync(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 } @@ -2153,7 +2986,23 @@ public void SetMachineResourcesRequestObject() Project = "", }; // Make the request - Operation response = instancesClient.SetMachineResources(request); + lro::Operation response = instancesClient.SetMachineResources(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSetMachineResources(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 } @@ -2174,7 +3023,23 @@ public async Task SetMachineResourcesRequestObjectAsync() Project = "", }; // Make the request - Operation response = await instancesClient.SetMachineResourcesAsync(request); + lro::Operation response = await instancesClient.SetMachineResourcesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSetMachineResourcesAsync(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 } @@ -2190,7 +3055,23 @@ public void SetMachineResources() string instance = ""; InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = new InstancesSetMachineResourcesRequest(); // Make the request - Operation response = instancesClient.SetMachineResources(project, zone, instance, instancesSetMachineResourcesRequestResource); + lro::Operation response = instancesClient.SetMachineResources(project, zone, instance, instancesSetMachineResourcesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSetMachineResources(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 } @@ -2207,7 +3088,23 @@ public async Task SetMachineResourcesAsync() string instance = ""; InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource = new InstancesSetMachineResourcesRequest(); // Make the request - Operation response = await instancesClient.SetMachineResourcesAsync(project, zone, instance, instancesSetMachineResourcesRequestResource); + lro::Operation response = await instancesClient.SetMachineResourcesAsync(project, zone, instance, instancesSetMachineResourcesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSetMachineResourcesAsync(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 } @@ -2227,7 +3124,23 @@ public void SetMachineTypeRequestObject() InstancesSetMachineTypeRequestResource = new InstancesSetMachineTypeRequest(), }; // Make the request - Operation response = instancesClient.SetMachineType(request); + lro::Operation response = instancesClient.SetMachineType(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSetMachineType(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 } @@ -2248,7 +3161,23 @@ public async Task SetMachineTypeRequestObjectAsync() InstancesSetMachineTypeRequestResource = new InstancesSetMachineTypeRequest(), }; // Make the request - Operation response = await instancesClient.SetMachineTypeAsync(request); + lro::Operation response = await instancesClient.SetMachineTypeAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSetMachineTypeAsync(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 } @@ -2264,7 +3193,23 @@ public void SetMachineType() string instance = ""; InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = new InstancesSetMachineTypeRequest(); // Make the request - Operation response = instancesClient.SetMachineType(project, zone, instance, instancesSetMachineTypeRequestResource); + lro::Operation response = instancesClient.SetMachineType(project, zone, instance, instancesSetMachineTypeRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSetMachineType(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 } @@ -2281,7 +3226,23 @@ public async Task SetMachineTypeAsync() string instance = ""; InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource = new InstancesSetMachineTypeRequest(); // Make the request - Operation response = await instancesClient.SetMachineTypeAsync(project, zone, instance, instancesSetMachineTypeRequestResource); + lro::Operation response = await instancesClient.SetMachineTypeAsync(project, zone, instance, instancesSetMachineTypeRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSetMachineTypeAsync(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 } @@ -2301,7 +3262,23 @@ public void SetMetadataRequestObject() MetadataResource = new Metadata(), }; // Make the request - Operation response = instancesClient.SetMetadata(request); + lro::Operation response = instancesClient.SetMetadata(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSetMetadata(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 } @@ -2322,7 +3299,23 @@ public async Task SetMetadataRequestObjectAsync() MetadataResource = new Metadata(), }; // Make the request - Operation response = await instancesClient.SetMetadataAsync(request); + lro::Operation response = await instancesClient.SetMetadataAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSetMetadataAsync(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 } @@ -2338,7 +3331,23 @@ public void SetMetadata() string instance = ""; Metadata metadataResource = new Metadata(); // Make the request - Operation response = instancesClient.SetMetadata(project, zone, instance, metadataResource); + lro::Operation response = instancesClient.SetMetadata(project, zone, instance, metadataResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSetMetadata(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 } @@ -2355,7 +3364,23 @@ public async Task SetMetadataAsync() string instance = ""; Metadata metadataResource = new Metadata(); // Make the request - Operation response = await instancesClient.SetMetadataAsync(project, zone, instance, metadataResource); + lro::Operation response = await instancesClient.SetMetadataAsync(project, zone, instance, metadataResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSetMetadataAsync(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 } @@ -2375,7 +3400,23 @@ public void SetMinCpuPlatformRequestObject() Project = "", }; // Make the request - Operation response = instancesClient.SetMinCpuPlatform(request); + lro::Operation response = instancesClient.SetMinCpuPlatform(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSetMinCpuPlatform(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 } @@ -2396,7 +3437,23 @@ public async Task SetMinCpuPlatformRequestObjectAsync() Project = "", }; // Make the request - Operation response = await instancesClient.SetMinCpuPlatformAsync(request); + lro::Operation response = await instancesClient.SetMinCpuPlatformAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSetMinCpuPlatformAsync(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 } @@ -2412,7 +3469,23 @@ public void SetMinCpuPlatform() string instance = ""; InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = new InstancesSetMinCpuPlatformRequest(); // Make the request - Operation response = instancesClient.SetMinCpuPlatform(project, zone, instance, instancesSetMinCpuPlatformRequestResource); + lro::Operation response = instancesClient.SetMinCpuPlatform(project, zone, instance, instancesSetMinCpuPlatformRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSetMinCpuPlatform(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 } @@ -2429,7 +3502,23 @@ public async Task SetMinCpuPlatformAsync() string instance = ""; InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource = new InstancesSetMinCpuPlatformRequest(); // Make the request - Operation response = await instancesClient.SetMinCpuPlatformAsync(project, zone, instance, instancesSetMinCpuPlatformRequestResource); + lro::Operation response = await instancesClient.SetMinCpuPlatformAsync(project, zone, instance, instancesSetMinCpuPlatformRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSetMinCpuPlatformAsync(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 } @@ -2449,7 +3538,23 @@ public void SetSchedulingRequestObject() SchedulingResource = new Scheduling(), }; // Make the request - Operation response = instancesClient.SetScheduling(request); + lro::Operation response = instancesClient.SetScheduling(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSetScheduling(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 } @@ -2470,7 +3575,23 @@ public async Task SetSchedulingRequestObjectAsync() SchedulingResource = new Scheduling(), }; // Make the request - Operation response = await instancesClient.SetSchedulingAsync(request); + lro::Operation response = await instancesClient.SetSchedulingAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSetSchedulingAsync(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 } @@ -2486,7 +3607,23 @@ public void SetScheduling() string instance = ""; Scheduling schedulingResource = new Scheduling(); // Make the request - Operation response = instancesClient.SetScheduling(project, zone, instance, schedulingResource); + lro::Operation response = instancesClient.SetScheduling(project, zone, instance, schedulingResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSetScheduling(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 } @@ -2503,7 +3640,23 @@ public async Task SetSchedulingAsync() string instance = ""; Scheduling schedulingResource = new Scheduling(); // Make the request - Operation response = await instancesClient.SetSchedulingAsync(project, zone, instance, schedulingResource); + lro::Operation response = await instancesClient.SetSchedulingAsync(project, zone, instance, schedulingResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSetSchedulingAsync(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 } @@ -2523,7 +3676,23 @@ public void SetServiceAccountRequestObject() InstancesSetServiceAccountRequestResource = new InstancesSetServiceAccountRequest(), }; // Make the request - Operation response = instancesClient.SetServiceAccount(request); + lro::Operation response = instancesClient.SetServiceAccount(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSetServiceAccount(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 } @@ -2544,7 +3713,23 @@ public async Task SetServiceAccountRequestObjectAsync() InstancesSetServiceAccountRequestResource = new InstancesSetServiceAccountRequest(), }; // Make the request - Operation response = await instancesClient.SetServiceAccountAsync(request); + lro::Operation response = await instancesClient.SetServiceAccountAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSetServiceAccountAsync(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 } @@ -2560,7 +3745,23 @@ public void SetServiceAccount() string instance = ""; InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = new InstancesSetServiceAccountRequest(); // Make the request - Operation response = instancesClient.SetServiceAccount(project, zone, instance, instancesSetServiceAccountRequestResource); + lro::Operation response = instancesClient.SetServiceAccount(project, zone, instance, instancesSetServiceAccountRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSetServiceAccount(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 } @@ -2577,7 +3778,23 @@ public async Task SetServiceAccountAsync() string instance = ""; InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource = new InstancesSetServiceAccountRequest(); // Make the request - Operation response = await instancesClient.SetServiceAccountAsync(project, zone, instance, instancesSetServiceAccountRequestResource); + lro::Operation response = await instancesClient.SetServiceAccountAsync(project, zone, instance, instancesSetServiceAccountRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSetServiceAccountAsync(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 } @@ -2597,7 +3814,23 @@ public void SetShieldedInstanceIntegrityPolicyRequestObject() ShieldedInstanceIntegrityPolicyResource = new ShieldedInstanceIntegrityPolicy(), }; // Make the request - Operation response = instancesClient.SetShieldedInstanceIntegrityPolicy(request); + lro::Operation response = instancesClient.SetShieldedInstanceIntegrityPolicy(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSetShieldedInstanceIntegrityPolicy(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 } @@ -2618,7 +3851,23 @@ public async Task SetShieldedInstanceIntegrityPolicyRequestObjectAsync() ShieldedInstanceIntegrityPolicyResource = new ShieldedInstanceIntegrityPolicy(), }; // Make the request - Operation response = await instancesClient.SetShieldedInstanceIntegrityPolicyAsync(request); + lro::Operation response = await instancesClient.SetShieldedInstanceIntegrityPolicyAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSetShieldedInstanceIntegrityPolicyAsync(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 } @@ -2634,7 +3883,23 @@ public void SetShieldedInstanceIntegrityPolicy() string instance = ""; ShieldedInstanceIntegrityPolicy shieldedInstanceIntegrityPolicyResource = new ShieldedInstanceIntegrityPolicy(); // Make the request - Operation response = instancesClient.SetShieldedInstanceIntegrityPolicy(project, zone, instance, shieldedInstanceIntegrityPolicyResource); + lro::Operation response = instancesClient.SetShieldedInstanceIntegrityPolicy(project, zone, instance, shieldedInstanceIntegrityPolicyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSetShieldedInstanceIntegrityPolicy(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 } @@ -2651,7 +3916,23 @@ public async Task SetShieldedInstanceIntegrityPolicyAsync() string instance = ""; ShieldedInstanceIntegrityPolicy shieldedInstanceIntegrityPolicyResource = new ShieldedInstanceIntegrityPolicy(); // Make the request - Operation response = await instancesClient.SetShieldedInstanceIntegrityPolicyAsync(project, zone, instance, shieldedInstanceIntegrityPolicyResource); + lro::Operation response = await instancesClient.SetShieldedInstanceIntegrityPolicyAsync(project, zone, instance, shieldedInstanceIntegrityPolicyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSetShieldedInstanceIntegrityPolicyAsync(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 } @@ -2671,7 +3952,23 @@ public void SetTagsRequestObject() TagsResource = new Tags(), }; // Make the request - Operation response = instancesClient.SetTags(request); + lro::Operation response = instancesClient.SetTags(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSetTags(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 } @@ -2692,7 +3989,23 @@ public async Task SetTagsRequestObjectAsync() TagsResource = new Tags(), }; // Make the request - Operation response = await instancesClient.SetTagsAsync(request); + lro::Operation response = await instancesClient.SetTagsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSetTagsAsync(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 } @@ -2708,7 +4021,23 @@ public void SetTags() string instance = ""; Tags tagsResource = new Tags(); // Make the request - Operation response = instancesClient.SetTags(project, zone, instance, tagsResource); + lro::Operation response = instancesClient.SetTags(project, zone, instance, tagsResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSetTags(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 } @@ -2725,7 +4054,23 @@ public async Task SetTagsAsync() string instance = ""; Tags tagsResource = new Tags(); // Make the request - Operation response = await instancesClient.SetTagsAsync(project, zone, instance, tagsResource); + lro::Operation response = await instancesClient.SetTagsAsync(project, zone, instance, tagsResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSetTagsAsync(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 } @@ -2743,7 +4088,23 @@ public void SimulateMaintenanceEventRequestObject() Project = "", }; // Make the request - Operation response = instancesClient.SimulateMaintenanceEvent(request); + lro::Operation response = instancesClient.SimulateMaintenanceEvent(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSimulateMaintenanceEvent(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 } @@ -2762,7 +4123,23 @@ public async Task SimulateMaintenanceEventRequestObjectAsync() Project = "", }; // Make the request - Operation response = await instancesClient.SimulateMaintenanceEventAsync(request); + lro::Operation response = await instancesClient.SimulateMaintenanceEventAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSimulateMaintenanceEventAsync(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 } @@ -2777,7 +4154,23 @@ public void SimulateMaintenanceEvent() string zone = ""; string instance = ""; // Make the request - Operation response = instancesClient.SimulateMaintenanceEvent(project, zone, instance); + lro::Operation response = instancesClient.SimulateMaintenanceEvent(project, zone, instance); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceSimulateMaintenanceEvent(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 } @@ -2793,7 +4186,23 @@ public async Task SimulateMaintenanceEventAsync() string zone = ""; string instance = ""; // Make the request - Operation response = await instancesClient.SimulateMaintenanceEventAsync(project, zone, instance); + lro::Operation response = await instancesClient.SimulateMaintenanceEventAsync(project, zone, instance); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceSimulateMaintenanceEventAsync(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 } @@ -2812,7 +4221,23 @@ public void StartRequestObject() Project = "", }; // Make the request - Operation response = instancesClient.Start(request); + lro::Operation response = instancesClient.Start(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceStart(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 } @@ -2832,7 +4257,23 @@ public async Task StartRequestObjectAsync() Project = "", }; // Make the request - Operation response = await instancesClient.StartAsync(request); + lro::Operation response = await instancesClient.StartAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceStartAsync(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 } @@ -2847,7 +4288,23 @@ public void Start() string zone = ""; string instance = ""; // Make the request - Operation response = instancesClient.Start(project, zone, instance); + lro::Operation response = instancesClient.Start(project, zone, instance); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceStart(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 } @@ -2863,7 +4320,23 @@ public async Task StartAsync() string zone = ""; string instance = ""; // Make the request - Operation response = await instancesClient.StartAsync(project, zone, instance); + lro::Operation response = await instancesClient.StartAsync(project, zone, instance); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceStartAsync(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 } @@ -2883,7 +4356,23 @@ public void StartWithEncryptionKeyRequestObject() InstancesStartWithEncryptionKeyRequestResource = new InstancesStartWithEncryptionKeyRequest(), }; // Make the request - Operation response = instancesClient.StartWithEncryptionKey(request); + lro::Operation response = instancesClient.StartWithEncryptionKey(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceStartWithEncryptionKey(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 } @@ -2904,7 +4393,23 @@ public async Task StartWithEncryptionKeyRequestObjectAsync() InstancesStartWithEncryptionKeyRequestResource = new InstancesStartWithEncryptionKeyRequest(), }; // Make the request - Operation response = await instancesClient.StartWithEncryptionKeyAsync(request); + lro::Operation response = await instancesClient.StartWithEncryptionKeyAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceStartWithEncryptionKeyAsync(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 } @@ -2920,7 +4425,23 @@ public void StartWithEncryptionKey() string instance = ""; InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = new InstancesStartWithEncryptionKeyRequest(); // Make the request - Operation response = instancesClient.StartWithEncryptionKey(project, zone, instance, instancesStartWithEncryptionKeyRequestResource); + lro::Operation response = instancesClient.StartWithEncryptionKey(project, zone, instance, instancesStartWithEncryptionKeyRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceStartWithEncryptionKey(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 } @@ -2937,7 +4458,23 @@ public async Task StartWithEncryptionKeyAsync() string instance = ""; InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource = new InstancesStartWithEncryptionKeyRequest(); // Make the request - Operation response = await instancesClient.StartWithEncryptionKeyAsync(project, zone, instance, instancesStartWithEncryptionKeyRequestResource); + lro::Operation response = await instancesClient.StartWithEncryptionKeyAsync(project, zone, instance, instancesStartWithEncryptionKeyRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceStartWithEncryptionKeyAsync(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 } @@ -2956,7 +4493,23 @@ public void StopRequestObject() Project = "", }; // Make the request - Operation response = instancesClient.Stop(request); + lro::Operation response = instancesClient.Stop(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceStop(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 } @@ -2976,7 +4529,23 @@ public async Task StopRequestObjectAsync() Project = "", }; // Make the request - Operation response = await instancesClient.StopAsync(request); + lro::Operation response = await instancesClient.StopAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceStopAsync(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 } @@ -2991,7 +4560,23 @@ public void Stop() string zone = ""; string instance = ""; // Make the request - Operation response = instancesClient.Stop(project, zone, instance); + lro::Operation response = instancesClient.Stop(project, zone, instance); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceStop(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 } @@ -3007,7 +4592,23 @@ public async Task StopAsync() string zone = ""; string instance = ""; // Make the request - Operation response = await instancesClient.StopAsync(project, zone, instance); + lro::Operation response = await instancesClient.StopAsync(project, zone, instance); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceStopAsync(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 } @@ -3101,7 +4702,23 @@ public void UpdateRequestObject() MinimalAction = "", }; // Make the request - Operation response = instancesClient.Update(request); + lro::Operation response = instancesClient.Update(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.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 } @@ -3124,7 +4741,23 @@ public async Task UpdateRequestObjectAsync() MinimalAction = "", }; // Make the request - Operation response = await instancesClient.UpdateAsync(request); + lro::Operation response = await instancesClient.UpdateAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceUpdateAsync(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 } @@ -3140,7 +4773,23 @@ public void Update() string instance = ""; Instance instanceResource = new Instance(); // Make the request - Operation response = instancesClient.Update(project, zone, instance, instanceResource); + lro::Operation response = instancesClient.Update(project, zone, instance, instanceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.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 } @@ -3157,7 +4806,23 @@ public async Task UpdateAsync() string instance = ""; Instance instanceResource = new Instance(); // Make the request - Operation response = await instancesClient.UpdateAsync(project, zone, instance, instanceResource); + lro::Operation response = await instancesClient.UpdateAsync(project, zone, instance, instanceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceUpdateAsync(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 } @@ -3178,7 +4843,23 @@ public void UpdateAccessConfigRequestObject() AccessConfigResource = new AccessConfig(), }; // Make the request - Operation response = instancesClient.UpdateAccessConfig(request); + lro::Operation response = instancesClient.UpdateAccessConfig(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceUpdateAccessConfig(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 } @@ -3200,7 +4881,23 @@ public async Task UpdateAccessConfigRequestObjectAsync() AccessConfigResource = new AccessConfig(), }; // Make the request - Operation response = await instancesClient.UpdateAccessConfigAsync(request); + lro::Operation response = await instancesClient.UpdateAccessConfigAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceUpdateAccessConfigAsync(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 } @@ -3217,7 +4914,23 @@ public void UpdateAccessConfig() string networkInterface = ""; AccessConfig accessConfigResource = new AccessConfig(); // Make the request - Operation response = instancesClient.UpdateAccessConfig(project, zone, instance, networkInterface, accessConfigResource); + lro::Operation response = instancesClient.UpdateAccessConfig(project, zone, instance, networkInterface, accessConfigResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceUpdateAccessConfig(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 } @@ -3235,7 +4948,23 @@ public async Task UpdateAccessConfigAsync() string networkInterface = ""; AccessConfig accessConfigResource = new AccessConfig(); // Make the request - Operation response = await instancesClient.UpdateAccessConfigAsync(project, zone, instance, networkInterface, accessConfigResource); + lro::Operation response = await instancesClient.UpdateAccessConfigAsync(project, zone, instance, networkInterface, accessConfigResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceUpdateAccessConfigAsync(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 } @@ -3255,7 +4984,23 @@ public void UpdateDisplayDeviceRequestObject() DisplayDeviceResource = new DisplayDevice(), }; // Make the request - Operation response = instancesClient.UpdateDisplayDevice(request); + lro::Operation response = instancesClient.UpdateDisplayDevice(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceUpdateDisplayDevice(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 } @@ -3276,7 +5021,23 @@ public async Task UpdateDisplayDeviceRequestObjectAsync() DisplayDeviceResource = new DisplayDevice(), }; // Make the request - Operation response = await instancesClient.UpdateDisplayDeviceAsync(request); + lro::Operation response = await instancesClient.UpdateDisplayDeviceAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceUpdateDisplayDeviceAsync(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 } @@ -3292,7 +5053,23 @@ public void UpdateDisplayDevice() string instance = ""; DisplayDevice displayDeviceResource = new DisplayDevice(); // Make the request - Operation response = instancesClient.UpdateDisplayDevice(project, zone, instance, displayDeviceResource); + lro::Operation response = instancesClient.UpdateDisplayDevice(project, zone, instance, displayDeviceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceUpdateDisplayDevice(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 } @@ -3309,7 +5086,23 @@ public async Task UpdateDisplayDeviceAsync() string instance = ""; DisplayDevice displayDeviceResource = new DisplayDevice(); // Make the request - Operation response = await instancesClient.UpdateDisplayDeviceAsync(project, zone, instance, displayDeviceResource); + lro::Operation response = await instancesClient.UpdateDisplayDeviceAsync(project, zone, instance, displayDeviceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceUpdateDisplayDeviceAsync(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 } @@ -3330,7 +5123,23 @@ public void UpdateNetworkInterfaceRequestObject() NetworkInterface = "", }; // Make the request - Operation response = instancesClient.UpdateNetworkInterface(request); + lro::Operation response = instancesClient.UpdateNetworkInterface(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceUpdateNetworkInterface(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 } @@ -3352,7 +5161,23 @@ public async Task UpdateNetworkInterfaceRequestObjectAsync() NetworkInterface = "", }; // Make the request - Operation response = await instancesClient.UpdateNetworkInterfaceAsync(request); + lro::Operation response = await instancesClient.UpdateNetworkInterfaceAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceUpdateNetworkInterfaceAsync(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 } @@ -3369,7 +5194,23 @@ public void UpdateNetworkInterface() string networkInterface = ""; NetworkInterface networkInterfaceResource = new NetworkInterface(); // Make the request - Operation response = instancesClient.UpdateNetworkInterface(project, zone, instance, networkInterface, networkInterfaceResource); + lro::Operation response = instancesClient.UpdateNetworkInterface(project, zone, instance, networkInterface, networkInterfaceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceUpdateNetworkInterface(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 } @@ -3387,7 +5228,23 @@ public async Task UpdateNetworkInterfaceAsync() string networkInterface = ""; NetworkInterface networkInterfaceResource = new NetworkInterface(); // Make the request - Operation response = await instancesClient.UpdateNetworkInterfaceAsync(project, zone, instance, networkInterface, networkInterfaceResource); + lro::Operation response = await instancesClient.UpdateNetworkInterfaceAsync(project, zone, instance, networkInterface, networkInterfaceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceUpdateNetworkInterfaceAsync(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 } @@ -3407,7 +5264,23 @@ public void UpdateShieldedInstanceConfigRequestObject() ShieldedInstanceConfigResource = new ShieldedInstanceConfig(), }; // Make the request - Operation response = instancesClient.UpdateShieldedInstanceConfig(request); + lro::Operation response = instancesClient.UpdateShieldedInstanceConfig(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceUpdateShieldedInstanceConfig(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 } @@ -3428,7 +5301,23 @@ public async Task UpdateShieldedInstanceConfigRequestObjectAsync() ShieldedInstanceConfigResource = new ShieldedInstanceConfig(), }; // Make the request - Operation response = await instancesClient.UpdateShieldedInstanceConfigAsync(request); + lro::Operation response = await instancesClient.UpdateShieldedInstanceConfigAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceUpdateShieldedInstanceConfigAsync(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 } @@ -3444,7 +5333,23 @@ public void UpdateShieldedInstanceConfig() string instance = ""; ShieldedInstanceConfig shieldedInstanceConfigResource = new ShieldedInstanceConfig(); // Make the request - Operation response = instancesClient.UpdateShieldedInstanceConfig(project, zone, instance, shieldedInstanceConfigResource); + lro::Operation response = instancesClient.UpdateShieldedInstanceConfig(project, zone, instance, shieldedInstanceConfigResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = instancesClient.PollOnceUpdateShieldedInstanceConfig(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 } @@ -3461,7 +5366,23 @@ public async Task UpdateShieldedInstanceConfigAsync() string instance = ""; ShieldedInstanceConfig shieldedInstanceConfigResource = new ShieldedInstanceConfig(); // Make the request - Operation response = await instancesClient.UpdateShieldedInstanceConfigAsync(project, zone, instance, shieldedInstanceConfigResource); + lro::Operation response = await instancesClient.UpdateShieldedInstanceConfigAsync(project, zone, instance, shieldedInstanceConfigResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await instancesClient.PollOnceUpdateShieldedInstanceConfigAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InterconnectAttachmentsClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InterconnectAttachmentsClientSnippets.g.cs index 54b480d3095f..b4bf9cc84554 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InterconnectAttachmentsClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InterconnectAttachmentsClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedInterconnectAttachmentsClientSnippets @@ -234,7 +235,23 @@ public void DeleteRequestObject() InterconnectAttachment = "", }; // Make the request - Operation response = interconnectAttachmentsClient.Delete(request); + lro::Operation response = interconnectAttachmentsClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = interconnectAttachmentsClient.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 } @@ -254,7 +271,23 @@ public async Task DeleteRequestObjectAsync() InterconnectAttachment = "", }; // Make the request - Operation response = await interconnectAttachmentsClient.DeleteAsync(request); + lro::Operation response = await interconnectAttachmentsClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await interconnectAttachmentsClient.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 } @@ -269,7 +302,23 @@ public void Delete() string region = ""; string interconnectAttachment = ""; // Make the request - Operation response = interconnectAttachmentsClient.Delete(project, region, interconnectAttachment); + lro::Operation response = interconnectAttachmentsClient.Delete(project, region, interconnectAttachment); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = interconnectAttachmentsClient.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 } @@ -285,7 +334,23 @@ public async Task DeleteAsync() string region = ""; string interconnectAttachment = ""; // Make the request - Operation response = await interconnectAttachmentsClient.DeleteAsync(project, region, interconnectAttachment); + lro::Operation response = await interconnectAttachmentsClient.DeleteAsync(project, region, interconnectAttachment); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await interconnectAttachmentsClient.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 } @@ -373,7 +438,23 @@ public void InsertRequestObject() ValidateOnly = false, }; // Make the request - Operation response = interconnectAttachmentsClient.Insert(request); + lro::Operation response = interconnectAttachmentsClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = interconnectAttachmentsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -394,7 +475,23 @@ public async Task InsertRequestObjectAsync() ValidateOnly = false, }; // Make the request - Operation response = await interconnectAttachmentsClient.InsertAsync(request); + lro::Operation response = await interconnectAttachmentsClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await interconnectAttachmentsClient.PollOnceInsertAsync(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 } @@ -409,7 +506,23 @@ public void Insert() string region = ""; InterconnectAttachment interconnectAttachmentResource = new InterconnectAttachment(); // Make the request - Operation response = interconnectAttachmentsClient.Insert(project, region, interconnectAttachmentResource); + lro::Operation response = interconnectAttachmentsClient.Insert(project, region, interconnectAttachmentResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = interconnectAttachmentsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -425,7 +538,23 @@ public async Task InsertAsync() string region = ""; InterconnectAttachment interconnectAttachmentResource = new InterconnectAttachment(); // Make the request - Operation response = await interconnectAttachmentsClient.InsertAsync(project, region, interconnectAttachmentResource); + lro::Operation response = await interconnectAttachmentsClient.InsertAsync(project, region, interconnectAttachmentResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await interconnectAttachmentsClient.PollOnceInsertAsync(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 } @@ -641,7 +770,23 @@ public void PatchRequestObject() InterconnectAttachment = "", }; // Make the request - Operation response = interconnectAttachmentsClient.Patch(request); + lro::Operation response = interconnectAttachmentsClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = interconnectAttachmentsClient.PollOncePatch(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 } @@ -662,7 +807,23 @@ public async Task PatchRequestObjectAsync() InterconnectAttachment = "", }; // Make the request - Operation response = await interconnectAttachmentsClient.PatchAsync(request); + lro::Operation response = await interconnectAttachmentsClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await interconnectAttachmentsClient.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 } @@ -678,7 +839,23 @@ public void Patch() string interconnectAttachment = ""; InterconnectAttachment interconnectAttachmentResource = new InterconnectAttachment(); // Make the request - Operation response = interconnectAttachmentsClient.Patch(project, region, interconnectAttachment, interconnectAttachmentResource); + lro::Operation response = interconnectAttachmentsClient.Patch(project, region, interconnectAttachment, interconnectAttachmentResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = interconnectAttachmentsClient.PollOncePatch(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 } @@ -695,7 +872,23 @@ public async Task PatchAsync() string interconnectAttachment = ""; InterconnectAttachment interconnectAttachmentResource = new InterconnectAttachment(); // Make the request - Operation response = await interconnectAttachmentsClient.PatchAsync(project, region, interconnectAttachment, interconnectAttachmentResource); + lro::Operation response = await interconnectAttachmentsClient.PatchAsync(project, region, interconnectAttachment, interconnectAttachmentResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await interconnectAttachmentsClient.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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InterconnectsClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InterconnectsClientSnippets.g.cs index 050fdaab0d2d..137f238e1047 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InterconnectsClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/InterconnectsClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedInterconnectsClientSnippets @@ -38,7 +39,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = interconnectsClient.Delete(request); + lro::Operation response = interconnectsClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = interconnectsClient.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 } @@ -57,7 +74,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await interconnectsClient.DeleteAsync(request); + lro::Operation response = await interconnectsClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await interconnectsClient.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 } @@ -71,7 +104,23 @@ public void Delete() string project = ""; string interconnect = ""; // Make the request - Operation response = interconnectsClient.Delete(project, interconnect); + lro::Operation response = interconnectsClient.Delete(project, interconnect); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = interconnectsClient.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 } @@ -86,7 +135,23 @@ public async Task DeleteAsync() string project = ""; string interconnect = ""; // Make the request - Operation response = await interconnectsClient.DeleteAsync(project, interconnect); + lro::Operation response = await interconnectsClient.DeleteAsync(project, interconnect); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await interconnectsClient.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 } @@ -232,7 +297,23 @@ public void InsertRequestObject() InterconnectResource = new Interconnect(), }; // Make the request - Operation response = interconnectsClient.Insert(request); + lro::Operation response = interconnectsClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = interconnectsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -251,7 +332,23 @@ public async Task InsertRequestObjectAsync() InterconnectResource = new Interconnect(), }; // Make the request - Operation response = await interconnectsClient.InsertAsync(request); + lro::Operation response = await interconnectsClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await interconnectsClient.PollOnceInsertAsync(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 } @@ -265,7 +362,23 @@ public void Insert() string project = ""; Interconnect interconnectResource = new Interconnect(); // Make the request - Operation response = interconnectsClient.Insert(project, interconnectResource); + lro::Operation response = interconnectsClient.Insert(project, interconnectResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = interconnectsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -280,7 +393,23 @@ public async Task InsertAsync() string project = ""; Interconnect interconnectResource = new Interconnect(); // Make the request - Operation response = await interconnectsClient.InsertAsync(project, interconnectResource); + lro::Operation response = await interconnectsClient.InsertAsync(project, interconnectResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await interconnectsClient.PollOnceInsertAsync(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 } @@ -491,7 +620,23 @@ public void PatchRequestObject() InterconnectResource = new Interconnect(), }; // Make the request - Operation response = interconnectsClient.Patch(request); + lro::Operation response = interconnectsClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = interconnectsClient.PollOncePatch(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 } @@ -511,7 +656,23 @@ public async Task PatchRequestObjectAsync() InterconnectResource = new Interconnect(), }; // Make the request - Operation response = await interconnectsClient.PatchAsync(request); + lro::Operation response = await interconnectsClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await interconnectsClient.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 } @@ -526,7 +687,23 @@ public void Patch() string interconnect = ""; Interconnect interconnectResource = new Interconnect(); // Make the request - Operation response = interconnectsClient.Patch(project, interconnect, interconnectResource); + lro::Operation response = interconnectsClient.Patch(project, interconnect, interconnectResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = interconnectsClient.PollOncePatch(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 } @@ -542,7 +719,23 @@ public async Task PatchAsync() string interconnect = ""; Interconnect interconnectResource = new Interconnect(); // Make the request - Operation response = await interconnectsClient.PatchAsync(project, interconnect, interconnectResource); + lro::Operation response = await interconnectsClient.PatchAsync(project, interconnect, interconnectResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await interconnectsClient.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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/LicensesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/LicensesClientSnippets.g.cs index 6a51a35129bf..4112fc9fe59e 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/LicensesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/LicensesClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedLicensesClientSnippets @@ -38,7 +39,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = licensesClient.Delete(request); + lro::Operation response = licensesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = licensesClient.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 } @@ -57,7 +74,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await licensesClient.DeleteAsync(request); + lro::Operation response = await licensesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await licensesClient.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 } @@ -71,7 +104,23 @@ public void Delete() string project = ""; string license = ""; // Make the request - Operation response = licensesClient.Delete(project, license); + lro::Operation response = licensesClient.Delete(project, license); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = licensesClient.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 } @@ -86,7 +135,23 @@ public async Task DeleteAsync() string project = ""; string license = ""; // Make the request - Operation response = await licensesClient.DeleteAsync(project, license); + lro::Operation response = await licensesClient.DeleteAsync(project, license); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await licensesClient.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 } @@ -234,7 +299,23 @@ public void InsertRequestObject() LicenseResource = new License(), }; // Make the request - Operation response = licensesClient.Insert(request); + lro::Operation response = licensesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = licensesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -253,7 +334,23 @@ public async Task InsertRequestObjectAsync() LicenseResource = new License(), }; // Make the request - Operation response = await licensesClient.InsertAsync(request); + lro::Operation response = await licensesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await licensesClient.PollOnceInsertAsync(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 } @@ -267,7 +364,23 @@ public void Insert() string project = ""; License licenseResource = new License(); // Make the request - Operation response = licensesClient.Insert(project, licenseResource); + lro::Operation response = licensesClient.Insert(project, licenseResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = licensesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -282,7 +395,23 @@ public async Task InsertAsync() string project = ""; License licenseResource = new License(); // Make the request - Operation response = await licensesClient.InsertAsync(project, licenseResource); + lro::Operation response = await licensesClient.InsertAsync(project, licenseResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await licensesClient.PollOnceInsertAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/NetworkEndpointGroupsClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/NetworkEndpointGroupsClientSnippets.g.cs index 29250b8b5eb3..d23da530d299 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/NetworkEndpointGroupsClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/NetworkEndpointGroupsClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedNetworkEndpointGroupsClientSnippets @@ -235,7 +236,23 @@ public void AttachNetworkEndpointsRequestObject() NetworkEndpointGroup = "", }; // Make the request - Operation response = networkEndpointGroupsClient.AttachNetworkEndpoints(request); + lro::Operation response = networkEndpointGroupsClient.AttachNetworkEndpoints(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = networkEndpointGroupsClient.PollOnceAttachNetworkEndpoints(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 } @@ -256,7 +273,23 @@ public async Task AttachNetworkEndpointsRequestObjectAsync() NetworkEndpointGroup = "", }; // Make the request - Operation response = await networkEndpointGroupsClient.AttachNetworkEndpointsAsync(request); + lro::Operation response = await networkEndpointGroupsClient.AttachNetworkEndpointsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await networkEndpointGroupsClient.PollOnceAttachNetworkEndpointsAsync(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 } @@ -272,7 +305,23 @@ public void AttachNetworkEndpoints() string networkEndpointGroup = ""; NetworkEndpointGroupsAttachEndpointsRequest networkEndpointGroupsAttachEndpointsRequestResource = new NetworkEndpointGroupsAttachEndpointsRequest(); // Make the request - Operation response = networkEndpointGroupsClient.AttachNetworkEndpoints(project, zone, networkEndpointGroup, networkEndpointGroupsAttachEndpointsRequestResource); + lro::Operation response = networkEndpointGroupsClient.AttachNetworkEndpoints(project, zone, networkEndpointGroup, networkEndpointGroupsAttachEndpointsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = networkEndpointGroupsClient.PollOnceAttachNetworkEndpoints(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 } @@ -289,7 +338,23 @@ public async Task AttachNetworkEndpointsAsync() string networkEndpointGroup = ""; NetworkEndpointGroupsAttachEndpointsRequest networkEndpointGroupsAttachEndpointsRequestResource = new NetworkEndpointGroupsAttachEndpointsRequest(); // Make the request - Operation response = await networkEndpointGroupsClient.AttachNetworkEndpointsAsync(project, zone, networkEndpointGroup, networkEndpointGroupsAttachEndpointsRequestResource); + lro::Operation response = await networkEndpointGroupsClient.AttachNetworkEndpointsAsync(project, zone, networkEndpointGroup, networkEndpointGroupsAttachEndpointsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await networkEndpointGroupsClient.PollOnceAttachNetworkEndpointsAsync(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 } @@ -308,7 +373,23 @@ public void DeleteRequestObject() NetworkEndpointGroup = "", }; // Make the request - Operation response = networkEndpointGroupsClient.Delete(request); + lro::Operation response = networkEndpointGroupsClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = networkEndpointGroupsClient.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 } @@ -328,7 +409,23 @@ public async Task DeleteRequestObjectAsync() NetworkEndpointGroup = "", }; // Make the request - Operation response = await networkEndpointGroupsClient.DeleteAsync(request); + lro::Operation response = await networkEndpointGroupsClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await networkEndpointGroupsClient.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 } @@ -343,7 +440,23 @@ public void Delete() string zone = ""; string networkEndpointGroup = ""; // Make the request - Operation response = networkEndpointGroupsClient.Delete(project, zone, networkEndpointGroup); + lro::Operation response = networkEndpointGroupsClient.Delete(project, zone, networkEndpointGroup); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = networkEndpointGroupsClient.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 } @@ -359,7 +472,23 @@ public async Task DeleteAsync() string zone = ""; string networkEndpointGroup = ""; // Make the request - Operation response = await networkEndpointGroupsClient.DeleteAsync(project, zone, networkEndpointGroup); + lro::Operation response = await networkEndpointGroupsClient.DeleteAsync(project, zone, networkEndpointGroup); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await networkEndpointGroupsClient.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 } @@ -379,7 +508,23 @@ public void DetachNetworkEndpointsRequestObject() NetworkEndpointGroupsDetachEndpointsRequestResource = new NetworkEndpointGroupsDetachEndpointsRequest(), }; // Make the request - Operation response = networkEndpointGroupsClient.DetachNetworkEndpoints(request); + lro::Operation response = networkEndpointGroupsClient.DetachNetworkEndpoints(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = networkEndpointGroupsClient.PollOnceDetachNetworkEndpoints(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 } @@ -400,7 +545,23 @@ public async Task DetachNetworkEndpointsRequestObjectAsync() NetworkEndpointGroupsDetachEndpointsRequestResource = new NetworkEndpointGroupsDetachEndpointsRequest(), }; // Make the request - Operation response = await networkEndpointGroupsClient.DetachNetworkEndpointsAsync(request); + lro::Operation response = await networkEndpointGroupsClient.DetachNetworkEndpointsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await networkEndpointGroupsClient.PollOnceDetachNetworkEndpointsAsync(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 } @@ -416,7 +577,23 @@ public void DetachNetworkEndpoints() string networkEndpointGroup = ""; NetworkEndpointGroupsDetachEndpointsRequest networkEndpointGroupsDetachEndpointsRequestResource = new NetworkEndpointGroupsDetachEndpointsRequest(); // Make the request - Operation response = networkEndpointGroupsClient.DetachNetworkEndpoints(project, zone, networkEndpointGroup, networkEndpointGroupsDetachEndpointsRequestResource); + lro::Operation response = networkEndpointGroupsClient.DetachNetworkEndpoints(project, zone, networkEndpointGroup, networkEndpointGroupsDetachEndpointsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = networkEndpointGroupsClient.PollOnceDetachNetworkEndpoints(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 } @@ -433,7 +610,23 @@ public async Task DetachNetworkEndpointsAsync() string networkEndpointGroup = ""; NetworkEndpointGroupsDetachEndpointsRequest networkEndpointGroupsDetachEndpointsRequestResource = new NetworkEndpointGroupsDetachEndpointsRequest(); // Make the request - Operation response = await networkEndpointGroupsClient.DetachNetworkEndpointsAsync(project, zone, networkEndpointGroup, networkEndpointGroupsDetachEndpointsRequestResource); + lro::Operation response = await networkEndpointGroupsClient.DetachNetworkEndpointsAsync(project, zone, networkEndpointGroup, networkEndpointGroupsDetachEndpointsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await networkEndpointGroupsClient.PollOnceDetachNetworkEndpointsAsync(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 } @@ -520,7 +713,23 @@ public void InsertRequestObject() NetworkEndpointGroupResource = new NetworkEndpointGroup(), }; // Make the request - Operation response = networkEndpointGroupsClient.Insert(request); + lro::Operation response = networkEndpointGroupsClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = networkEndpointGroupsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -540,7 +749,23 @@ public async Task InsertRequestObjectAsync() NetworkEndpointGroupResource = new NetworkEndpointGroup(), }; // Make the request - Operation response = await networkEndpointGroupsClient.InsertAsync(request); + lro::Operation response = await networkEndpointGroupsClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await networkEndpointGroupsClient.PollOnceInsertAsync(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 } @@ -555,7 +780,23 @@ public void Insert() string zone = ""; NetworkEndpointGroup networkEndpointGroupResource = new NetworkEndpointGroup(); // Make the request - Operation response = networkEndpointGroupsClient.Insert(project, zone, networkEndpointGroupResource); + lro::Operation response = networkEndpointGroupsClient.Insert(project, zone, networkEndpointGroupResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = networkEndpointGroupsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -571,7 +812,23 @@ public async Task InsertAsync() string zone = ""; NetworkEndpointGroup networkEndpointGroupResource = new NetworkEndpointGroup(); // Make the request - Operation response = await networkEndpointGroupsClient.InsertAsync(project, zone, networkEndpointGroupResource); + lro::Operation response = await networkEndpointGroupsClient.InsertAsync(project, zone, networkEndpointGroupResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await networkEndpointGroupsClient.PollOnceInsertAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/NetworksClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/NetworksClientSnippets.g.cs index fe064282cfe4..a99a064ce5b0 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/NetworksClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/NetworksClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedNetworksClientSnippets @@ -39,7 +40,23 @@ public void AddPeeringRequestObject() NetworksAddPeeringRequestResource = new NetworksAddPeeringRequest(), }; // Make the request - Operation response = networksClient.AddPeering(request); + lro::Operation response = networksClient.AddPeering(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = networksClient.PollOnceAddPeering(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 } @@ -59,7 +76,23 @@ public async Task AddPeeringRequestObjectAsync() NetworksAddPeeringRequestResource = new NetworksAddPeeringRequest(), }; // Make the request - Operation response = await networksClient.AddPeeringAsync(request); + lro::Operation response = await networksClient.AddPeeringAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await networksClient.PollOnceAddPeeringAsync(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 } @@ -74,7 +107,23 @@ public void AddPeering() string network = ""; NetworksAddPeeringRequest networksAddPeeringRequestResource = new NetworksAddPeeringRequest(); // Make the request - Operation response = networksClient.AddPeering(project, network, networksAddPeeringRequestResource); + lro::Operation response = networksClient.AddPeering(project, network, networksAddPeeringRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = networksClient.PollOnceAddPeering(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 } @@ -90,7 +139,23 @@ public async Task AddPeeringAsync() string network = ""; NetworksAddPeeringRequest networksAddPeeringRequestResource = new NetworksAddPeeringRequest(); // Make the request - Operation response = await networksClient.AddPeeringAsync(project, network, networksAddPeeringRequestResource); + lro::Operation response = await networksClient.AddPeeringAsync(project, network, networksAddPeeringRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await networksClient.PollOnceAddPeeringAsync(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 } @@ -108,7 +173,23 @@ public void DeleteRequestObject() Network = "", }; // Make the request - Operation response = networksClient.Delete(request); + lro::Operation response = networksClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = networksClient.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 } @@ -127,7 +208,23 @@ public async Task DeleteRequestObjectAsync() Network = "", }; // Make the request - Operation response = await networksClient.DeleteAsync(request); + lro::Operation response = await networksClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await networksClient.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 } @@ -141,7 +238,23 @@ public void Delete() string project = ""; string network = ""; // Make the request - Operation response = networksClient.Delete(project, network); + lro::Operation response = networksClient.Delete(project, network); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = networksClient.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 } @@ -156,7 +269,23 @@ public async Task DeleteAsync() string project = ""; string network = ""; // Make the request - Operation response = await networksClient.DeleteAsync(project, network); + lro::Operation response = await networksClient.DeleteAsync(project, network); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await networksClient.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 } @@ -302,7 +431,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = networksClient.Insert(request); + lro::Operation response = networksClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = networksClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -321,7 +466,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await networksClient.InsertAsync(request); + lro::Operation response = await networksClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await networksClient.PollOnceInsertAsync(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 } @@ -335,7 +496,23 @@ public void Insert() string project = ""; Network networkResource = new Network(); // Make the request - Operation response = networksClient.Insert(project, networkResource); + lro::Operation response = networksClient.Insert(project, networkResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = networksClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -350,7 +527,23 @@ public async Task InsertAsync() string project = ""; Network networkResource = new Network(); // Make the request - Operation response = await networksClient.InsertAsync(project, networkResource); + lro::Operation response = await networksClient.InsertAsync(project, networkResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await networksClient.PollOnceInsertAsync(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 } @@ -763,7 +956,23 @@ public void PatchRequestObject() Network = "", }; // Make the request - Operation response = networksClient.Patch(request); + lro::Operation response = networksClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = networksClient.PollOncePatch(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 } @@ -783,7 +992,23 @@ public async Task PatchRequestObjectAsync() Network = "", }; // Make the request - Operation response = await networksClient.PatchAsync(request); + lro::Operation response = await networksClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await networksClient.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 } @@ -798,7 +1023,23 @@ public void Patch() string network = ""; Network networkResource = new Network(); // Make the request - Operation response = networksClient.Patch(project, network, networkResource); + lro::Operation response = networksClient.Patch(project, network, networkResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = networksClient.PollOncePatch(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 } @@ -814,7 +1055,23 @@ public async Task PatchAsync() string network = ""; Network networkResource = new Network(); // Make the request - Operation response = await networksClient.PatchAsync(project, network, networkResource); + lro::Operation response = await networksClient.PatchAsync(project, network, networkResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await networksClient.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 } @@ -833,7 +1090,23 @@ public void RemovePeeringRequestObject() NetworksRemovePeeringRequestResource = new NetworksRemovePeeringRequest(), }; // Make the request - Operation response = networksClient.RemovePeering(request); + lro::Operation response = networksClient.RemovePeering(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = networksClient.PollOnceRemovePeering(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 } @@ -853,7 +1126,23 @@ public async Task RemovePeeringRequestObjectAsync() NetworksRemovePeeringRequestResource = new NetworksRemovePeeringRequest(), }; // Make the request - Operation response = await networksClient.RemovePeeringAsync(request); + lro::Operation response = await networksClient.RemovePeeringAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await networksClient.PollOnceRemovePeeringAsync(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 } @@ -868,7 +1157,23 @@ public void RemovePeering() string network = ""; NetworksRemovePeeringRequest networksRemovePeeringRequestResource = new NetworksRemovePeeringRequest(); // Make the request - Operation response = networksClient.RemovePeering(project, network, networksRemovePeeringRequestResource); + lro::Operation response = networksClient.RemovePeering(project, network, networksRemovePeeringRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = networksClient.PollOnceRemovePeering(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 } @@ -884,7 +1189,23 @@ public async Task RemovePeeringAsync() string network = ""; NetworksRemovePeeringRequest networksRemovePeeringRequestResource = new NetworksRemovePeeringRequest(); // Make the request - Operation response = await networksClient.RemovePeeringAsync(project, network, networksRemovePeeringRequestResource); + lro::Operation response = await networksClient.RemovePeeringAsync(project, network, networksRemovePeeringRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await networksClient.PollOnceRemovePeeringAsync(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 } @@ -902,7 +1223,23 @@ public void SwitchToCustomModeRequestObject() Network = "", }; // Make the request - Operation response = networksClient.SwitchToCustomMode(request); + lro::Operation response = networksClient.SwitchToCustomMode(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = networksClient.PollOnceSwitchToCustomMode(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 } @@ -921,7 +1258,23 @@ public async Task SwitchToCustomModeRequestObjectAsync() Network = "", }; // Make the request - Operation response = await networksClient.SwitchToCustomModeAsync(request); + lro::Operation response = await networksClient.SwitchToCustomModeAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await networksClient.PollOnceSwitchToCustomModeAsync(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 } @@ -935,7 +1288,23 @@ public void SwitchToCustomMode() string project = ""; string network = ""; // Make the request - Operation response = networksClient.SwitchToCustomMode(project, network); + lro::Operation response = networksClient.SwitchToCustomMode(project, network); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = networksClient.PollOnceSwitchToCustomMode(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 } @@ -950,7 +1319,23 @@ public async Task SwitchToCustomModeAsync() string project = ""; string network = ""; // Make the request - Operation response = await networksClient.SwitchToCustomModeAsync(project, network); + lro::Operation response = await networksClient.SwitchToCustomModeAsync(project, network); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await networksClient.PollOnceSwitchToCustomModeAsync(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 } @@ -969,7 +1354,23 @@ public void UpdatePeeringRequestObject() Network = "", }; // Make the request - Operation response = networksClient.UpdatePeering(request); + lro::Operation response = networksClient.UpdatePeering(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = networksClient.PollOnceUpdatePeering(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 } @@ -989,7 +1390,23 @@ public async Task UpdatePeeringRequestObjectAsync() Network = "", }; // Make the request - Operation response = await networksClient.UpdatePeeringAsync(request); + lro::Operation response = await networksClient.UpdatePeeringAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await networksClient.PollOnceUpdatePeeringAsync(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 } @@ -1004,7 +1421,23 @@ public void UpdatePeering() string network = ""; NetworksUpdatePeeringRequest networksUpdatePeeringRequestResource = new NetworksUpdatePeeringRequest(); // Make the request - Operation response = networksClient.UpdatePeering(project, network, networksUpdatePeeringRequestResource); + lro::Operation response = networksClient.UpdatePeering(project, network, networksUpdatePeeringRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = networksClient.PollOnceUpdatePeering(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 } @@ -1020,7 +1453,23 @@ public async Task UpdatePeeringAsync() string network = ""; NetworksUpdatePeeringRequest networksUpdatePeeringRequestResource = new NetworksUpdatePeeringRequest(); // Make the request - Operation response = await networksClient.UpdatePeeringAsync(project, network, networksUpdatePeeringRequestResource); + lro::Operation response = await networksClient.UpdatePeeringAsync(project, network, networksUpdatePeeringRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await networksClient.PollOnceUpdatePeeringAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/NodeGroupsClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/NodeGroupsClientSnippets.g.cs index 10a13c3ec5a8..530ba196d9a7 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/NodeGroupsClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/NodeGroupsClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedNodeGroupsClientSnippets @@ -41,7 +42,23 @@ public void AddNodesRequestObject() NodeGroup = "", }; // Make the request - Operation response = nodeGroupsClient.AddNodes(request); + lro::Operation response = nodeGroupsClient.AddNodes(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = nodeGroupsClient.PollOnceAddNodes(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 } @@ -62,7 +79,23 @@ public async Task AddNodesRequestObjectAsync() NodeGroup = "", }; // Make the request - Operation response = await nodeGroupsClient.AddNodesAsync(request); + lro::Operation response = await nodeGroupsClient.AddNodesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await nodeGroupsClient.PollOnceAddNodesAsync(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 } @@ -78,7 +111,23 @@ public void AddNodes() string nodeGroup = ""; NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource = new NodeGroupsAddNodesRequest(); // Make the request - Operation response = nodeGroupsClient.AddNodes(project, zone, nodeGroup, nodeGroupsAddNodesRequestResource); + lro::Operation response = nodeGroupsClient.AddNodes(project, zone, nodeGroup, nodeGroupsAddNodesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = nodeGroupsClient.PollOnceAddNodes(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 } @@ -95,7 +144,23 @@ public async Task AddNodesAsync() string nodeGroup = ""; NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource = new NodeGroupsAddNodesRequest(); // Make the request - Operation response = await nodeGroupsClient.AddNodesAsync(project, zone, nodeGroup, nodeGroupsAddNodesRequestResource); + lro::Operation response = await nodeGroupsClient.AddNodesAsync(project, zone, nodeGroup, nodeGroupsAddNodesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await nodeGroupsClient.PollOnceAddNodesAsync(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 } @@ -308,7 +373,23 @@ public void DeleteRequestObject() NodeGroup = "", }; // Make the request - Operation response = nodeGroupsClient.Delete(request); + lro::Operation response = nodeGroupsClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = nodeGroupsClient.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 } @@ -328,7 +409,23 @@ public async Task DeleteRequestObjectAsync() NodeGroup = "", }; // Make the request - Operation response = await nodeGroupsClient.DeleteAsync(request); + lro::Operation response = await nodeGroupsClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await nodeGroupsClient.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 } @@ -343,7 +440,23 @@ public void Delete() string zone = ""; string nodeGroup = ""; // Make the request - Operation response = nodeGroupsClient.Delete(project, zone, nodeGroup); + lro::Operation response = nodeGroupsClient.Delete(project, zone, nodeGroup); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = nodeGroupsClient.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 } @@ -359,7 +472,23 @@ public async Task DeleteAsync() string zone = ""; string nodeGroup = ""; // Make the request - Operation response = await nodeGroupsClient.DeleteAsync(project, zone, nodeGroup); + lro::Operation response = await nodeGroupsClient.DeleteAsync(project, zone, nodeGroup); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await nodeGroupsClient.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 } @@ -379,7 +508,23 @@ public void DeleteNodesRequestObject() NodeGroup = "", }; // Make the request - Operation response = nodeGroupsClient.DeleteNodes(request); + lro::Operation response = nodeGroupsClient.DeleteNodes(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = nodeGroupsClient.PollOnceDeleteNodes(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 } @@ -400,7 +545,23 @@ public async Task DeleteNodesRequestObjectAsync() NodeGroup = "", }; // Make the request - Operation response = await nodeGroupsClient.DeleteNodesAsync(request); + lro::Operation response = await nodeGroupsClient.DeleteNodesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await nodeGroupsClient.PollOnceDeleteNodesAsync(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 } @@ -416,7 +577,23 @@ public void DeleteNodes() string nodeGroup = ""; NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource = new NodeGroupsDeleteNodesRequest(); // Make the request - Operation response = nodeGroupsClient.DeleteNodes(project, zone, nodeGroup, nodeGroupsDeleteNodesRequestResource); + lro::Operation response = nodeGroupsClient.DeleteNodes(project, zone, nodeGroup, nodeGroupsDeleteNodesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = nodeGroupsClient.PollOnceDeleteNodes(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 } @@ -433,7 +610,23 @@ public async Task DeleteNodesAsync() string nodeGroup = ""; NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource = new NodeGroupsDeleteNodesRequest(); // Make the request - Operation response = await nodeGroupsClient.DeleteNodesAsync(project, zone, nodeGroup, nodeGroupsDeleteNodesRequestResource); + lro::Operation response = await nodeGroupsClient.DeleteNodesAsync(project, zone, nodeGroup, nodeGroupsDeleteNodesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await nodeGroupsClient.PollOnceDeleteNodesAsync(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 } @@ -591,7 +784,23 @@ public void InsertRequestObject() NodeGroupResource = new NodeGroup(), }; // Make the request - Operation response = nodeGroupsClient.Insert(request); + lro::Operation response = nodeGroupsClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = nodeGroupsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -612,7 +821,23 @@ public async Task InsertRequestObjectAsync() NodeGroupResource = new NodeGroup(), }; // Make the request - Operation response = await nodeGroupsClient.InsertAsync(request); + lro::Operation response = await nodeGroupsClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await nodeGroupsClient.PollOnceInsertAsync(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 } @@ -628,7 +853,23 @@ public void Insert() int initialNodeCount = 0; NodeGroup nodeGroupResource = new NodeGroup(); // Make the request - Operation response = nodeGroupsClient.Insert(project, zone, initialNodeCount, nodeGroupResource); + lro::Operation response = nodeGroupsClient.Insert(project, zone, initialNodeCount, nodeGroupResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = nodeGroupsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -645,7 +886,23 @@ public async Task InsertAsync() int initialNodeCount = 0; NodeGroup nodeGroupResource = new NodeGroup(); // Make the request - Operation response = await nodeGroupsClient.InsertAsync(project, zone, initialNodeCount, nodeGroupResource); + lro::Operation response = await nodeGroupsClient.InsertAsync(project, zone, initialNodeCount, nodeGroupResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await nodeGroupsClient.PollOnceInsertAsync(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 } @@ -1061,7 +1318,23 @@ public void PatchRequestObject() NodeGroupResource = new NodeGroup(), }; // Make the request - Operation response = nodeGroupsClient.Patch(request); + lro::Operation response = nodeGroupsClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = nodeGroupsClient.PollOncePatch(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 } @@ -1082,7 +1355,23 @@ public async Task PatchRequestObjectAsync() NodeGroupResource = new NodeGroup(), }; // Make the request - Operation response = await nodeGroupsClient.PatchAsync(request); + lro::Operation response = await nodeGroupsClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await nodeGroupsClient.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 } @@ -1098,7 +1387,23 @@ public void Patch() string nodeGroup = ""; NodeGroup nodeGroupResource = new NodeGroup(); // Make the request - Operation response = nodeGroupsClient.Patch(project, zone, nodeGroup, nodeGroupResource); + lro::Operation response = nodeGroupsClient.Patch(project, zone, nodeGroup, nodeGroupResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = nodeGroupsClient.PollOncePatch(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 } @@ -1115,7 +1420,23 @@ public async Task PatchAsync() string nodeGroup = ""; NodeGroup nodeGroupResource = new NodeGroup(); // Make the request - Operation response = await nodeGroupsClient.PatchAsync(project, zone, nodeGroup, nodeGroupResource); + lro::Operation response = await nodeGroupsClient.PatchAsync(project, zone, nodeGroup, nodeGroupResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await nodeGroupsClient.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 } @@ -1207,7 +1528,23 @@ public void SetNodeTemplateRequestObject() NodeGroup = "", }; // Make the request - Operation response = nodeGroupsClient.SetNodeTemplate(request); + lro::Operation response = nodeGroupsClient.SetNodeTemplate(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = nodeGroupsClient.PollOnceSetNodeTemplate(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 } @@ -1228,7 +1565,23 @@ public async Task SetNodeTemplateRequestObjectAsync() NodeGroup = "", }; // Make the request - Operation response = await nodeGroupsClient.SetNodeTemplateAsync(request); + lro::Operation response = await nodeGroupsClient.SetNodeTemplateAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await nodeGroupsClient.PollOnceSetNodeTemplateAsync(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 } @@ -1244,7 +1597,23 @@ public void SetNodeTemplate() string nodeGroup = ""; NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource = new NodeGroupsSetNodeTemplateRequest(); // Make the request - Operation response = nodeGroupsClient.SetNodeTemplate(project, zone, nodeGroup, nodeGroupsSetNodeTemplateRequestResource); + lro::Operation response = nodeGroupsClient.SetNodeTemplate(project, zone, nodeGroup, nodeGroupsSetNodeTemplateRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = nodeGroupsClient.PollOnceSetNodeTemplate(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 } @@ -1261,7 +1630,23 @@ public async Task SetNodeTemplateAsync() string nodeGroup = ""; NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource = new NodeGroupsSetNodeTemplateRequest(); // Make the request - Operation response = await nodeGroupsClient.SetNodeTemplateAsync(project, zone, nodeGroup, nodeGroupsSetNodeTemplateRequestResource); + lro::Operation response = await nodeGroupsClient.SetNodeTemplateAsync(project, zone, nodeGroup, nodeGroupsSetNodeTemplateRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await nodeGroupsClient.PollOnceSetNodeTemplateAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/NodeTemplatesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/NodeTemplatesClientSnippets.g.cs index 8326238112e5..92ea12f57b30 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/NodeTemplatesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/NodeTemplatesClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedNodeTemplatesClientSnippets @@ -234,7 +235,23 @@ public void DeleteRequestObject() NodeTemplate = "", }; // Make the request - Operation response = nodeTemplatesClient.Delete(request); + lro::Operation response = nodeTemplatesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = nodeTemplatesClient.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 } @@ -254,7 +271,23 @@ public async Task DeleteRequestObjectAsync() NodeTemplate = "", }; // Make the request - Operation response = await nodeTemplatesClient.DeleteAsync(request); + lro::Operation response = await nodeTemplatesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await nodeTemplatesClient.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 } @@ -269,7 +302,23 @@ public void Delete() string region = ""; string nodeTemplate = ""; // Make the request - Operation response = nodeTemplatesClient.Delete(project, region, nodeTemplate); + lro::Operation response = nodeTemplatesClient.Delete(project, region, nodeTemplate); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = nodeTemplatesClient.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 } @@ -285,7 +334,23 @@ public async Task DeleteAsync() string region = ""; string nodeTemplate = ""; // Make the request - Operation response = await nodeTemplatesClient.DeleteAsync(project, region, nodeTemplate); + lro::Operation response = await nodeTemplatesClient.DeleteAsync(project, region, nodeTemplate); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await nodeTemplatesClient.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 } @@ -442,7 +507,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = nodeTemplatesClient.Insert(request); + lro::Operation response = nodeTemplatesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = nodeTemplatesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -462,7 +543,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await nodeTemplatesClient.InsertAsync(request); + lro::Operation response = await nodeTemplatesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await nodeTemplatesClient.PollOnceInsertAsync(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 } @@ -477,7 +574,23 @@ public void Insert() string region = ""; NodeTemplate nodeTemplateResource = new NodeTemplate(); // Make the request - Operation response = nodeTemplatesClient.Insert(project, region, nodeTemplateResource); + lro::Operation response = nodeTemplatesClient.Insert(project, region, nodeTemplateResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = nodeTemplatesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -493,7 +606,23 @@ public async Task InsertAsync() string region = ""; NodeTemplate nodeTemplateResource = new NodeTemplate(); // Make the request - Operation response = await nodeTemplatesClient.InsertAsync(project, region, nodeTemplateResource); + lro::Operation response = await nodeTemplatesClient.InsertAsync(project, region, nodeTemplateResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await nodeTemplatesClient.PollOnceInsertAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/PacketMirroringsClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/PacketMirroringsClientSnippets.g.cs index d19473e2f9d1..18d8369a3ee0 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/PacketMirroringsClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/PacketMirroringsClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedPacketMirroringsClientSnippets @@ -234,7 +235,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = packetMirroringsClient.Delete(request); + lro::Operation response = packetMirroringsClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = packetMirroringsClient.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 } @@ -254,7 +271,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await packetMirroringsClient.DeleteAsync(request); + lro::Operation response = await packetMirroringsClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await packetMirroringsClient.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 } @@ -269,7 +302,23 @@ public void Delete() string region = ""; string packetMirroring = ""; // Make the request - Operation response = packetMirroringsClient.Delete(project, region, packetMirroring); + lro::Operation response = packetMirroringsClient.Delete(project, region, packetMirroring); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = packetMirroringsClient.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 } @@ -285,7 +334,23 @@ public async Task DeleteAsync() string region = ""; string packetMirroring = ""; // Make the request - Operation response = await packetMirroringsClient.DeleteAsync(project, region, packetMirroring); + lro::Operation response = await packetMirroringsClient.DeleteAsync(project, region, packetMirroring); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await packetMirroringsClient.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 } @@ -372,7 +437,23 @@ public void InsertRequestObject() PacketMirroringResource = new PacketMirroring(), }; // Make the request - Operation response = packetMirroringsClient.Insert(request); + lro::Operation response = packetMirroringsClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = packetMirroringsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -392,7 +473,23 @@ public async Task InsertRequestObjectAsync() PacketMirroringResource = new PacketMirroring(), }; // Make the request - Operation response = await packetMirroringsClient.InsertAsync(request); + lro::Operation response = await packetMirroringsClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await packetMirroringsClient.PollOnceInsertAsync(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 } @@ -407,7 +504,23 @@ public void Insert() string region = ""; PacketMirroring packetMirroringResource = new PacketMirroring(); // Make the request - Operation response = packetMirroringsClient.Insert(project, region, packetMirroringResource); + lro::Operation response = packetMirroringsClient.Insert(project, region, packetMirroringResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = packetMirroringsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -423,7 +536,23 @@ public async Task InsertAsync() string region = ""; PacketMirroring packetMirroringResource = new PacketMirroring(); // Make the request - Operation response = await packetMirroringsClient.InsertAsync(project, region, packetMirroringResource); + lro::Operation response = await packetMirroringsClient.InsertAsync(project, region, packetMirroringResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await packetMirroringsClient.PollOnceInsertAsync(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 } @@ -639,7 +768,23 @@ public void PatchRequestObject() PacketMirroringResource = new PacketMirroring(), }; // Make the request - Operation response = packetMirroringsClient.Patch(request); + lro::Operation response = packetMirroringsClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = packetMirroringsClient.PollOncePatch(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 } @@ -660,7 +805,23 @@ public async Task PatchRequestObjectAsync() PacketMirroringResource = new PacketMirroring(), }; // Make the request - Operation response = await packetMirroringsClient.PatchAsync(request); + lro::Operation response = await packetMirroringsClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await packetMirroringsClient.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 } @@ -676,7 +837,23 @@ public void Patch() string packetMirroring = ""; PacketMirroring packetMirroringResource = new PacketMirroring(); // Make the request - Operation response = packetMirroringsClient.Patch(project, region, packetMirroring, packetMirroringResource); + lro::Operation response = packetMirroringsClient.Patch(project, region, packetMirroring, packetMirroringResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = packetMirroringsClient.PollOncePatch(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 } @@ -693,7 +870,23 @@ public async Task PatchAsync() string packetMirroring = ""; PacketMirroring packetMirroringResource = new PacketMirroring(); // Make the request - Operation response = await packetMirroringsClient.PatchAsync(project, region, packetMirroring, packetMirroringResource); + lro::Operation response = await packetMirroringsClient.PatchAsync(project, region, packetMirroring, packetMirroringResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await packetMirroringsClient.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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ProjectsClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ProjectsClientSnippets.g.cs index e1b9304fe12c..b05bf65c9677 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ProjectsClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ProjectsClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedProjectsClientSnippets @@ -37,7 +38,23 @@ public void DisableXpnHostRequestObject() Project = "", }; // Make the request - Operation response = projectsClient.DisableXpnHost(request); + lro::Operation response = projectsClient.DisableXpnHost(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = projectsClient.PollOnceDisableXpnHost(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 } @@ -55,7 +72,23 @@ public async Task DisableXpnHostRequestObjectAsync() Project = "", }; // Make the request - Operation response = await projectsClient.DisableXpnHostAsync(request); + lro::Operation response = await projectsClient.DisableXpnHostAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await projectsClient.PollOnceDisableXpnHostAsync(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 } @@ -68,7 +101,23 @@ public void DisableXpnHost() // Initialize request argument(s) string project = ""; // Make the request - Operation response = projectsClient.DisableXpnHost(project); + lro::Operation response = projectsClient.DisableXpnHost(project); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = projectsClient.PollOnceDisableXpnHost(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 } @@ -82,7 +131,23 @@ public async Task DisableXpnHostAsync() // Initialize request argument(s) string project = ""; // Make the request - Operation response = await projectsClient.DisableXpnHostAsync(project); + lro::Operation response = await projectsClient.DisableXpnHostAsync(project); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await projectsClient.PollOnceDisableXpnHostAsync(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 } @@ -100,7 +165,23 @@ public void DisableXpnResourceRequestObject() Project = "", }; // Make the request - Operation response = projectsClient.DisableXpnResource(request); + lro::Operation response = projectsClient.DisableXpnResource(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = projectsClient.PollOnceDisableXpnResource(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 } @@ -119,7 +200,23 @@ public async Task DisableXpnResourceRequestObjectAsync() Project = "", }; // Make the request - Operation response = await projectsClient.DisableXpnResourceAsync(request); + lro::Operation response = await projectsClient.DisableXpnResourceAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await projectsClient.PollOnceDisableXpnResourceAsync(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 } @@ -133,7 +230,23 @@ public void DisableXpnResource() string project = ""; ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource = new ProjectsDisableXpnResourceRequest(); // Make the request - Operation response = projectsClient.DisableXpnResource(project, projectsDisableXpnResourceRequestResource); + lro::Operation response = projectsClient.DisableXpnResource(project, projectsDisableXpnResourceRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = projectsClient.PollOnceDisableXpnResource(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 } @@ -148,7 +261,23 @@ public async Task DisableXpnResourceAsync() string project = ""; ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource = new ProjectsDisableXpnResourceRequest(); // Make the request - Operation response = await projectsClient.DisableXpnResourceAsync(project, projectsDisableXpnResourceRequestResource); + lro::Operation response = await projectsClient.DisableXpnResourceAsync(project, projectsDisableXpnResourceRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await projectsClient.PollOnceDisableXpnResourceAsync(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 } @@ -165,7 +294,23 @@ public void EnableXpnHostRequestObject() Project = "", }; // Make the request - Operation response = projectsClient.EnableXpnHost(request); + lro::Operation response = projectsClient.EnableXpnHost(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = projectsClient.PollOnceEnableXpnHost(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 } @@ -183,7 +328,23 @@ public async Task EnableXpnHostRequestObjectAsync() Project = "", }; // Make the request - Operation response = await projectsClient.EnableXpnHostAsync(request); + lro::Operation response = await projectsClient.EnableXpnHostAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await projectsClient.PollOnceEnableXpnHostAsync(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 } @@ -196,7 +357,23 @@ public void EnableXpnHost() // Initialize request argument(s) string project = ""; // Make the request - Operation response = projectsClient.EnableXpnHost(project); + lro::Operation response = projectsClient.EnableXpnHost(project); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = projectsClient.PollOnceEnableXpnHost(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 } @@ -210,7 +387,23 @@ public async Task EnableXpnHostAsync() // Initialize request argument(s) string project = ""; // Make the request - Operation response = await projectsClient.EnableXpnHostAsync(project); + lro::Operation response = await projectsClient.EnableXpnHostAsync(project); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await projectsClient.PollOnceEnableXpnHostAsync(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 } @@ -228,7 +421,23 @@ public void EnableXpnResourceRequestObject() ProjectsEnableXpnResourceRequestResource = new ProjectsEnableXpnResourceRequest(), }; // Make the request - Operation response = projectsClient.EnableXpnResource(request); + lro::Operation response = projectsClient.EnableXpnResource(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = projectsClient.PollOnceEnableXpnResource(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 } @@ -247,7 +456,23 @@ public async Task EnableXpnResourceRequestObjectAsync() ProjectsEnableXpnResourceRequestResource = new ProjectsEnableXpnResourceRequest(), }; // Make the request - Operation response = await projectsClient.EnableXpnResourceAsync(request); + lro::Operation response = await projectsClient.EnableXpnResourceAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await projectsClient.PollOnceEnableXpnResourceAsync(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 } @@ -261,7 +486,23 @@ public void EnableXpnResource() string project = ""; ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource = new ProjectsEnableXpnResourceRequest(); // Make the request - Operation response = projectsClient.EnableXpnResource(project, projectsEnableXpnResourceRequestResource); + lro::Operation response = projectsClient.EnableXpnResource(project, projectsEnableXpnResourceRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = projectsClient.PollOnceEnableXpnResource(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 } @@ -276,7 +517,23 @@ public async Task EnableXpnResourceAsync() string project = ""; ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource = new ProjectsEnableXpnResourceRequest(); // Make the request - Operation response = await projectsClient.EnableXpnResourceAsync(project, projectsEnableXpnResourceRequestResource); + lro::Operation response = await projectsClient.EnableXpnResourceAsync(project, projectsEnableXpnResourceRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await projectsClient.PollOnceEnableXpnResourceAsync(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 } @@ -790,7 +1047,23 @@ public void MoveDiskRequestObject() DiskMoveRequestResource = new DiskMoveRequest(), }; // Make the request - Operation response = projectsClient.MoveDisk(request); + lro::Operation response = projectsClient.MoveDisk(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = projectsClient.PollOnceMoveDisk(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 } @@ -809,7 +1082,23 @@ public async Task MoveDiskRequestObjectAsync() DiskMoveRequestResource = new DiskMoveRequest(), }; // Make the request - Operation response = await projectsClient.MoveDiskAsync(request); + lro::Operation response = await projectsClient.MoveDiskAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await projectsClient.PollOnceMoveDiskAsync(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 } @@ -823,7 +1112,23 @@ public void MoveDisk() string project = ""; DiskMoveRequest diskMoveRequestResource = new DiskMoveRequest(); // Make the request - Operation response = projectsClient.MoveDisk(project, diskMoveRequestResource); + lro::Operation response = projectsClient.MoveDisk(project, diskMoveRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = projectsClient.PollOnceMoveDisk(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 } @@ -838,7 +1143,23 @@ public async Task MoveDiskAsync() string project = ""; DiskMoveRequest diskMoveRequestResource = new DiskMoveRequest(); // Make the request - Operation response = await projectsClient.MoveDiskAsync(project, diskMoveRequestResource); + lro::Operation response = await projectsClient.MoveDiskAsync(project, diskMoveRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await projectsClient.PollOnceMoveDiskAsync(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 } @@ -856,7 +1177,23 @@ public void MoveInstanceRequestObject() InstanceMoveRequestResource = new InstanceMoveRequest(), }; // Make the request - Operation response = projectsClient.MoveInstance(request); + lro::Operation response = projectsClient.MoveInstance(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = projectsClient.PollOnceMoveInstance(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 } @@ -875,7 +1212,23 @@ public async Task MoveInstanceRequestObjectAsync() InstanceMoveRequestResource = new InstanceMoveRequest(), }; // Make the request - Operation response = await projectsClient.MoveInstanceAsync(request); + lro::Operation response = await projectsClient.MoveInstanceAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await projectsClient.PollOnceMoveInstanceAsync(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 } @@ -889,7 +1242,23 @@ public void MoveInstance() string project = ""; InstanceMoveRequest instanceMoveRequestResource = new InstanceMoveRequest(); // Make the request - Operation response = projectsClient.MoveInstance(project, instanceMoveRequestResource); + lro::Operation response = projectsClient.MoveInstance(project, instanceMoveRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = projectsClient.PollOnceMoveInstance(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 } @@ -904,7 +1273,23 @@ public async Task MoveInstanceAsync() string project = ""; InstanceMoveRequest instanceMoveRequestResource = new InstanceMoveRequest(); // Make the request - Operation response = await projectsClient.MoveInstanceAsync(project, instanceMoveRequestResource); + lro::Operation response = await projectsClient.MoveInstanceAsync(project, instanceMoveRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await projectsClient.PollOnceMoveInstanceAsync(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 } @@ -922,7 +1307,23 @@ public void SetCommonInstanceMetadataRequestObject() MetadataResource = new Metadata(), }; // Make the request - Operation response = projectsClient.SetCommonInstanceMetadata(request); + lro::Operation response = projectsClient.SetCommonInstanceMetadata(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = projectsClient.PollOnceSetCommonInstanceMetadata(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 } @@ -941,7 +1342,23 @@ public async Task SetCommonInstanceMetadataRequestObjectAsync() MetadataResource = new Metadata(), }; // Make the request - Operation response = await projectsClient.SetCommonInstanceMetadataAsync(request); + lro::Operation response = await projectsClient.SetCommonInstanceMetadataAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await projectsClient.PollOnceSetCommonInstanceMetadataAsync(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 } @@ -955,7 +1372,23 @@ public void SetCommonInstanceMetadata() string project = ""; Metadata metadataResource = new Metadata(); // Make the request - Operation response = projectsClient.SetCommonInstanceMetadata(project, metadataResource); + lro::Operation response = projectsClient.SetCommonInstanceMetadata(project, metadataResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = projectsClient.PollOnceSetCommonInstanceMetadata(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 } @@ -970,7 +1403,23 @@ public async Task SetCommonInstanceMetadataAsync() string project = ""; Metadata metadataResource = new Metadata(); // Make the request - Operation response = await projectsClient.SetCommonInstanceMetadataAsync(project, metadataResource); + lro::Operation response = await projectsClient.SetCommonInstanceMetadataAsync(project, metadataResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await projectsClient.PollOnceSetCommonInstanceMetadataAsync(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 } @@ -988,7 +1437,23 @@ public void SetDefaultNetworkTierRequestObject() Project = "", }; // Make the request - Operation response = projectsClient.SetDefaultNetworkTier(request); + lro::Operation response = projectsClient.SetDefaultNetworkTier(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = projectsClient.PollOnceSetDefaultNetworkTier(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 } @@ -1007,7 +1472,23 @@ public async Task SetDefaultNetworkTierRequestObjectAsync() Project = "", }; // Make the request - Operation response = await projectsClient.SetDefaultNetworkTierAsync(request); + lro::Operation response = await projectsClient.SetDefaultNetworkTierAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await projectsClient.PollOnceSetDefaultNetworkTierAsync(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 } @@ -1021,7 +1502,23 @@ public void SetDefaultNetworkTier() string project = ""; ProjectsSetDefaultNetworkTierRequest projectsSetDefaultNetworkTierRequestResource = new ProjectsSetDefaultNetworkTierRequest(); // Make the request - Operation response = projectsClient.SetDefaultNetworkTier(project, projectsSetDefaultNetworkTierRequestResource); + lro::Operation response = projectsClient.SetDefaultNetworkTier(project, projectsSetDefaultNetworkTierRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = projectsClient.PollOnceSetDefaultNetworkTier(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 } @@ -1036,7 +1533,23 @@ public async Task SetDefaultNetworkTierAsync() string project = ""; ProjectsSetDefaultNetworkTierRequest projectsSetDefaultNetworkTierRequestResource = new ProjectsSetDefaultNetworkTierRequest(); // Make the request - Operation response = await projectsClient.SetDefaultNetworkTierAsync(project, projectsSetDefaultNetworkTierRequestResource); + lro::Operation response = await projectsClient.SetDefaultNetworkTierAsync(project, projectsSetDefaultNetworkTierRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await projectsClient.PollOnceSetDefaultNetworkTierAsync(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 } @@ -1054,7 +1567,23 @@ public void SetUsageExportBucketRequestObject() Project = "", }; // Make the request - Operation response = projectsClient.SetUsageExportBucket(request); + lro::Operation response = projectsClient.SetUsageExportBucket(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = projectsClient.PollOnceSetUsageExportBucket(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 } @@ -1073,7 +1602,23 @@ public async Task SetUsageExportBucketRequestObjectAsync() Project = "", }; // Make the request - Operation response = await projectsClient.SetUsageExportBucketAsync(request); + lro::Operation response = await projectsClient.SetUsageExportBucketAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await projectsClient.PollOnceSetUsageExportBucketAsync(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 } @@ -1087,7 +1632,23 @@ public void SetUsageExportBucket() string project = ""; UsageExportLocation usageExportLocationResource = new UsageExportLocation(); // Make the request - Operation response = projectsClient.SetUsageExportBucket(project, usageExportLocationResource); + lro::Operation response = projectsClient.SetUsageExportBucket(project, usageExportLocationResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = projectsClient.PollOnceSetUsageExportBucket(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 } @@ -1102,7 +1663,23 @@ public async Task SetUsageExportBucketAsync() string project = ""; UsageExportLocation usageExportLocationResource = new UsageExportLocation(); // Make the request - Operation response = await projectsClient.SetUsageExportBucketAsync(project, usageExportLocationResource); + lro::Operation response = await projectsClient.SetUsageExportBucketAsync(project, usageExportLocationResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await projectsClient.PollOnceSetUsageExportBucketAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/PublicAdvertisedPrefixesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/PublicAdvertisedPrefixesClientSnippets.g.cs index b1463480ef13..9a7051a60724 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/PublicAdvertisedPrefixesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/PublicAdvertisedPrefixesClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedPublicAdvertisedPrefixesClientSnippets @@ -38,7 +39,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = publicAdvertisedPrefixesClient.Delete(request); + lro::Operation response = publicAdvertisedPrefixesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = publicAdvertisedPrefixesClient.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 } @@ -57,7 +74,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await publicAdvertisedPrefixesClient.DeleteAsync(request); + lro::Operation response = await publicAdvertisedPrefixesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await publicAdvertisedPrefixesClient.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 } @@ -71,7 +104,23 @@ public void Delete() string project = ""; string publicAdvertisedPrefix = ""; // Make the request - Operation response = publicAdvertisedPrefixesClient.Delete(project, publicAdvertisedPrefix); + lro::Operation response = publicAdvertisedPrefixesClient.Delete(project, publicAdvertisedPrefix); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = publicAdvertisedPrefixesClient.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 } @@ -86,7 +135,23 @@ public async Task DeleteAsync() string project = ""; string publicAdvertisedPrefix = ""; // Make the request - Operation response = await publicAdvertisedPrefixesClient.DeleteAsync(project, publicAdvertisedPrefix); + lro::Operation response = await publicAdvertisedPrefixesClient.DeleteAsync(project, publicAdvertisedPrefix); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await publicAdvertisedPrefixesClient.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 } @@ -168,7 +233,23 @@ public void InsertRequestObject() PublicAdvertisedPrefixResource = new PublicAdvertisedPrefix(), }; // Make the request - Operation response = publicAdvertisedPrefixesClient.Insert(request); + lro::Operation response = publicAdvertisedPrefixesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = publicAdvertisedPrefixesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -187,7 +268,23 @@ public async Task InsertRequestObjectAsync() PublicAdvertisedPrefixResource = new PublicAdvertisedPrefix(), }; // Make the request - Operation response = await publicAdvertisedPrefixesClient.InsertAsync(request); + lro::Operation response = await publicAdvertisedPrefixesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await publicAdvertisedPrefixesClient.PollOnceInsertAsync(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 } @@ -201,7 +298,23 @@ public void Insert() string project = ""; PublicAdvertisedPrefix publicAdvertisedPrefixResource = new PublicAdvertisedPrefix(); // Make the request - Operation response = publicAdvertisedPrefixesClient.Insert(project, publicAdvertisedPrefixResource); + lro::Operation response = publicAdvertisedPrefixesClient.Insert(project, publicAdvertisedPrefixResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = publicAdvertisedPrefixesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -216,7 +329,23 @@ public async Task InsertAsync() string project = ""; PublicAdvertisedPrefix publicAdvertisedPrefixResource = new PublicAdvertisedPrefix(); // Make the request - Operation response = await publicAdvertisedPrefixesClient.InsertAsync(project, publicAdvertisedPrefixResource); + lro::Operation response = await publicAdvertisedPrefixesClient.InsertAsync(project, publicAdvertisedPrefixResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await publicAdvertisedPrefixesClient.PollOnceInsertAsync(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 } @@ -427,7 +556,23 @@ public void PatchRequestObject() PublicAdvertisedPrefixResource = new PublicAdvertisedPrefix(), }; // Make the request - Operation response = publicAdvertisedPrefixesClient.Patch(request); + lro::Operation response = publicAdvertisedPrefixesClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = publicAdvertisedPrefixesClient.PollOncePatch(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 } @@ -447,7 +592,23 @@ public async Task PatchRequestObjectAsync() PublicAdvertisedPrefixResource = new PublicAdvertisedPrefix(), }; // Make the request - Operation response = await publicAdvertisedPrefixesClient.PatchAsync(request); + lro::Operation response = await publicAdvertisedPrefixesClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await publicAdvertisedPrefixesClient.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 } @@ -462,7 +623,23 @@ public void Patch() string publicAdvertisedPrefix = ""; PublicAdvertisedPrefix publicAdvertisedPrefixResource = new PublicAdvertisedPrefix(); // Make the request - Operation response = publicAdvertisedPrefixesClient.Patch(project, publicAdvertisedPrefix, publicAdvertisedPrefixResource); + lro::Operation response = publicAdvertisedPrefixesClient.Patch(project, publicAdvertisedPrefix, publicAdvertisedPrefixResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = publicAdvertisedPrefixesClient.PollOncePatch(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 } @@ -478,7 +655,23 @@ public async Task PatchAsync() string publicAdvertisedPrefix = ""; PublicAdvertisedPrefix publicAdvertisedPrefixResource = new PublicAdvertisedPrefix(); // Make the request - Operation response = await publicAdvertisedPrefixesClient.PatchAsync(project, publicAdvertisedPrefix, publicAdvertisedPrefixResource); + lro::Operation response = await publicAdvertisedPrefixesClient.PatchAsync(project, publicAdvertisedPrefix, publicAdvertisedPrefixResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await publicAdvertisedPrefixesClient.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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/PublicDelegatedPrefixesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/PublicDelegatedPrefixesClientSnippets.g.cs index e2a4e45a89e8..73f32b0d4ae2 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/PublicDelegatedPrefixesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/PublicDelegatedPrefixesClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedPublicDelegatedPrefixesClientSnippets @@ -234,7 +235,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = publicDelegatedPrefixesClient.Delete(request); + lro::Operation response = publicDelegatedPrefixesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = publicDelegatedPrefixesClient.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 } @@ -254,7 +271,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await publicDelegatedPrefixesClient.DeleteAsync(request); + lro::Operation response = await publicDelegatedPrefixesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await publicDelegatedPrefixesClient.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 } @@ -269,7 +302,23 @@ public void Delete() string region = ""; string publicDelegatedPrefix = ""; // Make the request - Operation response = publicDelegatedPrefixesClient.Delete(project, region, publicDelegatedPrefix); + lro::Operation response = publicDelegatedPrefixesClient.Delete(project, region, publicDelegatedPrefix); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = publicDelegatedPrefixesClient.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 } @@ -285,7 +334,23 @@ public async Task DeleteAsync() string region = ""; string publicDelegatedPrefix = ""; // Make the request - Operation response = await publicDelegatedPrefixesClient.DeleteAsync(project, region, publicDelegatedPrefix); + lro::Operation response = await publicDelegatedPrefixesClient.DeleteAsync(project, region, publicDelegatedPrefix); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await publicDelegatedPrefixesClient.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 } @@ -372,7 +437,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = publicDelegatedPrefixesClient.Insert(request); + lro::Operation response = publicDelegatedPrefixesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = publicDelegatedPrefixesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -392,7 +473,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await publicDelegatedPrefixesClient.InsertAsync(request); + lro::Operation response = await publicDelegatedPrefixesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await publicDelegatedPrefixesClient.PollOnceInsertAsync(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 } @@ -407,7 +504,23 @@ public void Insert() string region = ""; PublicDelegatedPrefix publicDelegatedPrefixResource = new PublicDelegatedPrefix(); // Make the request - Operation response = publicDelegatedPrefixesClient.Insert(project, region, publicDelegatedPrefixResource); + lro::Operation response = publicDelegatedPrefixesClient.Insert(project, region, publicDelegatedPrefixResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = publicDelegatedPrefixesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -423,7 +536,23 @@ public async Task InsertAsync() string region = ""; PublicDelegatedPrefix publicDelegatedPrefixResource = new PublicDelegatedPrefix(); // Make the request - Operation response = await publicDelegatedPrefixesClient.InsertAsync(project, region, publicDelegatedPrefixResource); + lro::Operation response = await publicDelegatedPrefixesClient.InsertAsync(project, region, publicDelegatedPrefixResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await publicDelegatedPrefixesClient.PollOnceInsertAsync(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 } @@ -639,7 +768,23 @@ public void PatchRequestObject() Project = "", }; // Make the request - Operation response = publicDelegatedPrefixesClient.Patch(request); + lro::Operation response = publicDelegatedPrefixesClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = publicDelegatedPrefixesClient.PollOncePatch(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 } @@ -660,7 +805,23 @@ public async Task PatchRequestObjectAsync() Project = "", }; // Make the request - Operation response = await publicDelegatedPrefixesClient.PatchAsync(request); + lro::Operation response = await publicDelegatedPrefixesClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await publicDelegatedPrefixesClient.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 } @@ -676,7 +837,23 @@ public void Patch() string publicDelegatedPrefix = ""; PublicDelegatedPrefix publicDelegatedPrefixResource = new PublicDelegatedPrefix(); // Make the request - Operation response = publicDelegatedPrefixesClient.Patch(project, region, publicDelegatedPrefix, publicDelegatedPrefixResource); + lro::Operation response = publicDelegatedPrefixesClient.Patch(project, region, publicDelegatedPrefix, publicDelegatedPrefixResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = publicDelegatedPrefixesClient.PollOncePatch(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 } @@ -693,7 +870,23 @@ public async Task PatchAsync() string publicDelegatedPrefix = ""; PublicDelegatedPrefix publicDelegatedPrefixResource = new PublicDelegatedPrefix(); // Make the request - Operation response = await publicDelegatedPrefixesClient.PatchAsync(project, region, publicDelegatedPrefix, publicDelegatedPrefixResource); + lro::Operation response = await publicDelegatedPrefixesClient.PatchAsync(project, region, publicDelegatedPrefix, publicDelegatedPrefixResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await publicDelegatedPrefixesClient.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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionAutoscalersClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionAutoscalersClientSnippets.g.cs index f88c4e2bc46b..d3a890f16d61 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionAutoscalersClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionAutoscalersClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedRegionAutoscalersClientSnippets @@ -39,7 +40,23 @@ public void DeleteRequestObject() Autoscaler = "", }; // Make the request - Operation response = regionAutoscalersClient.Delete(request); + lro::Operation response = regionAutoscalersClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionAutoscalersClient.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 } @@ -59,7 +76,23 @@ public async Task DeleteRequestObjectAsync() Autoscaler = "", }; // Make the request - Operation response = await regionAutoscalersClient.DeleteAsync(request); + lro::Operation response = await regionAutoscalersClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionAutoscalersClient.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 } @@ -74,7 +107,23 @@ public void Delete() string region = ""; string autoscaler = ""; // Make the request - Operation response = regionAutoscalersClient.Delete(project, region, autoscaler); + lro::Operation response = regionAutoscalersClient.Delete(project, region, autoscaler); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionAutoscalersClient.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 } @@ -90,7 +139,23 @@ public async Task DeleteAsync() string region = ""; string autoscaler = ""; // Make the request - Operation response = await regionAutoscalersClient.DeleteAsync(project, region, autoscaler); + lro::Operation response = await regionAutoscalersClient.DeleteAsync(project, region, autoscaler); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionAutoscalersClient.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 } @@ -177,7 +242,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = regionAutoscalersClient.Insert(request); + lro::Operation response = regionAutoscalersClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionAutoscalersClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -197,7 +278,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await regionAutoscalersClient.InsertAsync(request); + lro::Operation response = await regionAutoscalersClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionAutoscalersClient.PollOnceInsertAsync(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 } @@ -212,7 +309,23 @@ public void Insert() string region = ""; Autoscaler autoscalerResource = new Autoscaler(); // Make the request - Operation response = regionAutoscalersClient.Insert(project, region, autoscalerResource); + lro::Operation response = regionAutoscalersClient.Insert(project, region, autoscalerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionAutoscalersClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -228,7 +341,23 @@ public async Task InsertAsync() string region = ""; Autoscaler autoscalerResource = new Autoscaler(); // Make the request - Operation response = await regionAutoscalersClient.InsertAsync(project, region, autoscalerResource); + lro::Operation response = await regionAutoscalersClient.InsertAsync(project, region, autoscalerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionAutoscalersClient.PollOnceInsertAsync(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 } @@ -444,7 +573,23 @@ public void PatchRequestObject() Autoscaler = "", }; // Make the request - Operation response = regionAutoscalersClient.Patch(request); + lro::Operation response = regionAutoscalersClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionAutoscalersClient.PollOncePatch(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 } @@ -465,7 +610,23 @@ public async Task PatchRequestObjectAsync() Autoscaler = "", }; // Make the request - Operation response = await regionAutoscalersClient.PatchAsync(request); + lro::Operation response = await regionAutoscalersClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionAutoscalersClient.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 } @@ -480,7 +641,23 @@ public void Patch() string region = ""; Autoscaler autoscalerResource = new Autoscaler(); // Make the request - Operation response = regionAutoscalersClient.Patch(project, region, autoscalerResource); + lro::Operation response = regionAutoscalersClient.Patch(project, region, autoscalerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionAutoscalersClient.PollOncePatch(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 } @@ -496,7 +673,23 @@ public async Task PatchAsync() string region = ""; Autoscaler autoscalerResource = new Autoscaler(); // Make the request - Operation response = await regionAutoscalersClient.PatchAsync(project, region, autoscalerResource); + lro::Operation response = await regionAutoscalersClient.PatchAsync(project, region, autoscalerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionAutoscalersClient.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 } @@ -516,7 +709,23 @@ public void UpdateRequestObject() Autoscaler = "", }; // Make the request - Operation response = regionAutoscalersClient.Update(request); + lro::Operation response = regionAutoscalersClient.Update(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionAutoscalersClient.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 } @@ -537,7 +746,23 @@ public async Task UpdateRequestObjectAsync() Autoscaler = "", }; // Make the request - Operation response = await regionAutoscalersClient.UpdateAsync(request); + lro::Operation response = await regionAutoscalersClient.UpdateAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionAutoscalersClient.PollOnceUpdateAsync(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 } @@ -552,7 +777,23 @@ public void Update() string region = ""; Autoscaler autoscalerResource = new Autoscaler(); // Make the request - Operation response = regionAutoscalersClient.Update(project, region, autoscalerResource); + lro::Operation response = regionAutoscalersClient.Update(project, region, autoscalerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionAutoscalersClient.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 } @@ -568,7 +809,23 @@ public async Task UpdateAsync() string region = ""; Autoscaler autoscalerResource = new Autoscaler(); // Make the request - Operation response = await regionAutoscalersClient.UpdateAsync(project, region, autoscalerResource); + lro::Operation response = await regionAutoscalersClient.UpdateAsync(project, region, autoscalerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionAutoscalersClient.PollOnceUpdateAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionBackendServicesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionBackendServicesClientSnippets.g.cs index f0cc2b694563..73a8e8d6fd34 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionBackendServicesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionBackendServicesClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedRegionBackendServicesClientSnippets @@ -39,7 +40,23 @@ public void DeleteRequestObject() BackendService = "", }; // Make the request - Operation response = regionBackendServicesClient.Delete(request); + lro::Operation response = regionBackendServicesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionBackendServicesClient.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 } @@ -59,7 +76,23 @@ public async Task DeleteRequestObjectAsync() BackendService = "", }; // Make the request - Operation response = await regionBackendServicesClient.DeleteAsync(request); + lro::Operation response = await regionBackendServicesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionBackendServicesClient.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 } @@ -74,7 +107,23 @@ public void Delete() string region = ""; string backendService = ""; // Make the request - Operation response = regionBackendServicesClient.Delete(project, region, backendService); + lro::Operation response = regionBackendServicesClient.Delete(project, region, backendService); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionBackendServicesClient.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 } @@ -90,7 +139,23 @@ public async Task DeleteAsync() string region = ""; string backendService = ""; // Make the request - Operation response = await regionBackendServicesClient.DeleteAsync(project, region, backendService); + lro::Operation response = await regionBackendServicesClient.DeleteAsync(project, region, backendService); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionBackendServicesClient.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 } @@ -249,7 +314,23 @@ public void InsertRequestObject() BackendServiceResource = new BackendService(), }; // Make the request - Operation response = regionBackendServicesClient.Insert(request); + lro::Operation response = regionBackendServicesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionBackendServicesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -269,7 +350,23 @@ public async Task InsertRequestObjectAsync() BackendServiceResource = new BackendService(), }; // Make the request - Operation response = await regionBackendServicesClient.InsertAsync(request); + lro::Operation response = await regionBackendServicesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionBackendServicesClient.PollOnceInsertAsync(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 } @@ -284,7 +381,23 @@ public void Insert() string region = ""; BackendService backendServiceResource = new BackendService(); // Make the request - Operation response = regionBackendServicesClient.Insert(project, region, backendServiceResource); + lro::Operation response = regionBackendServicesClient.Insert(project, region, backendServiceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionBackendServicesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -300,7 +413,23 @@ public async Task InsertAsync() string region = ""; BackendService backendServiceResource = new BackendService(); // Make the request - Operation response = await regionBackendServicesClient.InsertAsync(project, region, backendServiceResource); + lro::Operation response = await regionBackendServicesClient.InsertAsync(project, region, backendServiceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionBackendServicesClient.PollOnceInsertAsync(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 } @@ -516,7 +645,23 @@ public void PatchRequestObject() BackendServiceResource = new BackendService(), }; // Make the request - Operation response = regionBackendServicesClient.Patch(request); + lro::Operation response = regionBackendServicesClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionBackendServicesClient.PollOncePatch(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 } @@ -537,7 +682,23 @@ public async Task PatchRequestObjectAsync() BackendServiceResource = new BackendService(), }; // Make the request - Operation response = await regionBackendServicesClient.PatchAsync(request); + lro::Operation response = await regionBackendServicesClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionBackendServicesClient.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 } @@ -553,7 +714,23 @@ public void Patch() string backendService = ""; BackendService backendServiceResource = new BackendService(); // Make the request - Operation response = regionBackendServicesClient.Patch(project, region, backendService, backendServiceResource); + lro::Operation response = regionBackendServicesClient.Patch(project, region, backendService, backendServiceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionBackendServicesClient.PollOncePatch(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 } @@ -570,7 +747,23 @@ public async Task PatchAsync() string backendService = ""; BackendService backendServiceResource = new BackendService(); // Make the request - Operation response = await regionBackendServicesClient.PatchAsync(project, region, backendService, backendServiceResource); + lro::Operation response = await regionBackendServicesClient.PatchAsync(project, region, backendService, backendServiceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionBackendServicesClient.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 } @@ -590,7 +783,23 @@ public void UpdateRequestObject() BackendServiceResource = new BackendService(), }; // Make the request - Operation response = regionBackendServicesClient.Update(request); + lro::Operation response = regionBackendServicesClient.Update(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionBackendServicesClient.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 } @@ -611,7 +820,23 @@ public async Task UpdateRequestObjectAsync() BackendServiceResource = new BackendService(), }; // Make the request - Operation response = await regionBackendServicesClient.UpdateAsync(request); + lro::Operation response = await regionBackendServicesClient.UpdateAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionBackendServicesClient.PollOnceUpdateAsync(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 } @@ -627,7 +852,23 @@ public void Update() string backendService = ""; BackendService backendServiceResource = new BackendService(); // Make the request - Operation response = regionBackendServicesClient.Update(project, region, backendService, backendServiceResource); + lro::Operation response = regionBackendServicesClient.Update(project, region, backendService, backendServiceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionBackendServicesClient.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 } @@ -644,7 +885,23 @@ public async Task UpdateAsync() string backendService = ""; BackendService backendServiceResource = new BackendService(); // Make the request - Operation response = await regionBackendServicesClient.UpdateAsync(project, region, backendService, backendServiceResource); + lro::Operation response = await regionBackendServicesClient.UpdateAsync(project, region, backendService, backendServiceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionBackendServicesClient.PollOnceUpdateAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionCommitmentsClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionCommitmentsClientSnippets.g.cs index 043b8d81ffc6..d362f6260fb6 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionCommitmentsClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionCommitmentsClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedRegionCommitmentsClientSnippets @@ -302,7 +303,23 @@ public void InsertRequestObject() CommitmentResource = new Commitment(), }; // Make the request - Operation response = regionCommitmentsClient.Insert(request); + lro::Operation response = regionCommitmentsClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionCommitmentsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -322,7 +339,23 @@ public async Task InsertRequestObjectAsync() CommitmentResource = new Commitment(), }; // Make the request - Operation response = await regionCommitmentsClient.InsertAsync(request); + lro::Operation response = await regionCommitmentsClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionCommitmentsClient.PollOnceInsertAsync(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 } @@ -337,7 +370,23 @@ public void Insert() string region = ""; Commitment commitmentResource = new Commitment(); // Make the request - Operation response = regionCommitmentsClient.Insert(project, region, commitmentResource); + lro::Operation response = regionCommitmentsClient.Insert(project, region, commitmentResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionCommitmentsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -353,7 +402,23 @@ public async Task InsertAsync() string region = ""; Commitment commitmentResource = new Commitment(); // Make the request - Operation response = await regionCommitmentsClient.InsertAsync(project, region, commitmentResource); + lro::Operation response = await regionCommitmentsClient.InsertAsync(project, region, commitmentResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionCommitmentsClient.PollOnceInsertAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionDisksClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionDisksClientSnippets.g.cs index b5160eb985b7..be7bbe86477b 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionDisksClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionDisksClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedRegionDisksClientSnippets @@ -40,7 +41,23 @@ public void AddResourcePoliciesRequestObject() RegionDisksAddResourcePoliciesRequestResource = new RegionDisksAddResourcePoliciesRequest(), }; // Make the request - Operation response = regionDisksClient.AddResourcePolicies(request); + lro::Operation response = regionDisksClient.AddResourcePolicies(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionDisksClient.PollOnceAddResourcePolicies(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 } @@ -61,7 +78,23 @@ public async Task AddResourcePoliciesRequestObjectAsync() RegionDisksAddResourcePoliciesRequestResource = new RegionDisksAddResourcePoliciesRequest(), }; // Make the request - Operation response = await regionDisksClient.AddResourcePoliciesAsync(request); + lro::Operation response = await regionDisksClient.AddResourcePoliciesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionDisksClient.PollOnceAddResourcePoliciesAsync(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 } @@ -77,7 +110,23 @@ public void AddResourcePolicies() string disk = ""; RegionDisksAddResourcePoliciesRequest regionDisksAddResourcePoliciesRequestResource = new RegionDisksAddResourcePoliciesRequest(); // Make the request - Operation response = regionDisksClient.AddResourcePolicies(project, region, disk, regionDisksAddResourcePoliciesRequestResource); + lro::Operation response = regionDisksClient.AddResourcePolicies(project, region, disk, regionDisksAddResourcePoliciesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionDisksClient.PollOnceAddResourcePolicies(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 } @@ -94,7 +143,23 @@ public async Task AddResourcePoliciesAsync() string disk = ""; RegionDisksAddResourcePoliciesRequest regionDisksAddResourcePoliciesRequestResource = new RegionDisksAddResourcePoliciesRequest(); // Make the request - Operation response = await regionDisksClient.AddResourcePoliciesAsync(project, region, disk, regionDisksAddResourcePoliciesRequestResource); + lro::Operation response = await regionDisksClient.AddResourcePoliciesAsync(project, region, disk, regionDisksAddResourcePoliciesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionDisksClient.PollOnceAddResourcePoliciesAsync(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 } @@ -114,7 +179,23 @@ public void CreateSnapshotRequestObject() SnapshotResource = new Snapshot(), }; // Make the request - Operation response = regionDisksClient.CreateSnapshot(request); + lro::Operation response = regionDisksClient.CreateSnapshot(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionDisksClient.PollOnceCreateSnapshot(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 } @@ -135,7 +216,23 @@ public async Task CreateSnapshotRequestObjectAsync() SnapshotResource = new Snapshot(), }; // Make the request - Operation response = await regionDisksClient.CreateSnapshotAsync(request); + lro::Operation response = await regionDisksClient.CreateSnapshotAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionDisksClient.PollOnceCreateSnapshotAsync(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 } @@ -151,7 +248,23 @@ public void CreateSnapshot() string disk = ""; Snapshot snapshotResource = new Snapshot(); // Make the request - Operation response = regionDisksClient.CreateSnapshot(project, region, disk, snapshotResource); + lro::Operation response = regionDisksClient.CreateSnapshot(project, region, disk, snapshotResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionDisksClient.PollOnceCreateSnapshot(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 } @@ -168,7 +281,23 @@ public async Task CreateSnapshotAsync() string disk = ""; Snapshot snapshotResource = new Snapshot(); // Make the request - Operation response = await regionDisksClient.CreateSnapshotAsync(project, region, disk, snapshotResource); + lro::Operation response = await regionDisksClient.CreateSnapshotAsync(project, region, disk, snapshotResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionDisksClient.PollOnceCreateSnapshotAsync(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 } @@ -187,7 +316,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = regionDisksClient.Delete(request); + lro::Operation response = regionDisksClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionDisksClient.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 } @@ -207,7 +352,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await regionDisksClient.DeleteAsync(request); + lro::Operation response = await regionDisksClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionDisksClient.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 } @@ -222,7 +383,23 @@ public void Delete() string region = ""; string disk = ""; // Make the request - Operation response = regionDisksClient.Delete(project, region, disk); + lro::Operation response = regionDisksClient.Delete(project, region, disk); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionDisksClient.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 } @@ -238,7 +415,23 @@ public async Task DeleteAsync() string region = ""; string disk = ""; // Make the request - Operation response = await regionDisksClient.DeleteAsync(project, region, disk); + lro::Operation response = await regionDisksClient.DeleteAsync(project, region, disk); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionDisksClient.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 } @@ -396,7 +589,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = regionDisksClient.Insert(request); + lro::Operation response = regionDisksClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionDisksClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -417,7 +626,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await regionDisksClient.InsertAsync(request); + lro::Operation response = await regionDisksClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionDisksClient.PollOnceInsertAsync(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 } @@ -432,7 +657,23 @@ public void Insert() string region = ""; Disk diskResource = new Disk(); // Make the request - Operation response = regionDisksClient.Insert(project, region, diskResource); + lro::Operation response = regionDisksClient.Insert(project, region, diskResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionDisksClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -448,7 +689,23 @@ public async Task InsertAsync() string region = ""; Disk diskResource = new Disk(); // Make the request - Operation response = await regionDisksClient.InsertAsync(project, region, diskResource); + lro::Operation response = await regionDisksClient.InsertAsync(project, region, diskResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionDisksClient.PollOnceInsertAsync(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 } @@ -664,7 +921,23 @@ public void RemoveResourcePoliciesRequestObject() Project = "", }; // Make the request - Operation response = regionDisksClient.RemoveResourcePolicies(request); + lro::Operation response = regionDisksClient.RemoveResourcePolicies(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionDisksClient.PollOnceRemoveResourcePolicies(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 } @@ -685,7 +958,23 @@ public async Task RemoveResourcePoliciesRequestObjectAsync() Project = "", }; // Make the request - Operation response = await regionDisksClient.RemoveResourcePoliciesAsync(request); + lro::Operation response = await regionDisksClient.RemoveResourcePoliciesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionDisksClient.PollOnceRemoveResourcePoliciesAsync(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 } @@ -701,7 +990,23 @@ public void RemoveResourcePolicies() string disk = ""; RegionDisksRemoveResourcePoliciesRequest regionDisksRemoveResourcePoliciesRequestResource = new RegionDisksRemoveResourcePoliciesRequest(); // Make the request - Operation response = regionDisksClient.RemoveResourcePolicies(project, region, disk, regionDisksRemoveResourcePoliciesRequestResource); + lro::Operation response = regionDisksClient.RemoveResourcePolicies(project, region, disk, regionDisksRemoveResourcePoliciesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionDisksClient.PollOnceRemoveResourcePolicies(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 } @@ -718,7 +1023,23 @@ public async Task RemoveResourcePoliciesAsync() string disk = ""; RegionDisksRemoveResourcePoliciesRequest regionDisksRemoveResourcePoliciesRequestResource = new RegionDisksRemoveResourcePoliciesRequest(); // Make the request - Operation response = await regionDisksClient.RemoveResourcePoliciesAsync(project, region, disk, regionDisksRemoveResourcePoliciesRequestResource); + lro::Operation response = await regionDisksClient.RemoveResourcePoliciesAsync(project, region, disk, regionDisksRemoveResourcePoliciesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionDisksClient.PollOnceRemoveResourcePoliciesAsync(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 } @@ -738,7 +1059,23 @@ public void ResizeRequestObject() RegionDisksResizeRequestResource = new RegionDisksResizeRequest(), }; // Make the request - Operation response = regionDisksClient.Resize(request); + lro::Operation response = regionDisksClient.Resize(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionDisksClient.PollOnceResize(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 } @@ -759,7 +1096,23 @@ public async Task ResizeRequestObjectAsync() RegionDisksResizeRequestResource = new RegionDisksResizeRequest(), }; // Make the request - Operation response = await regionDisksClient.ResizeAsync(request); + lro::Operation response = await regionDisksClient.ResizeAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionDisksClient.PollOnceResizeAsync(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 } @@ -775,7 +1128,23 @@ public void Resize() string disk = ""; RegionDisksResizeRequest regionDisksResizeRequestResource = new RegionDisksResizeRequest(); // Make the request - Operation response = regionDisksClient.Resize(project, region, disk, regionDisksResizeRequestResource); + lro::Operation response = regionDisksClient.Resize(project, region, disk, regionDisksResizeRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionDisksClient.PollOnceResize(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 } @@ -792,7 +1161,23 @@ public async Task ResizeAsync() string disk = ""; RegionDisksResizeRequest regionDisksResizeRequestResource = new RegionDisksResizeRequest(); // Make the request - Operation response = await regionDisksClient.ResizeAsync(project, region, disk, regionDisksResizeRequestResource); + lro::Operation response = await regionDisksClient.ResizeAsync(project, region, disk, regionDisksResizeRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionDisksClient.PollOnceResizeAsync(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 } @@ -884,7 +1269,23 @@ public void SetLabelsRequestObject() RegionSetLabelsRequestResource = new RegionSetLabelsRequest(), }; // Make the request - Operation response = regionDisksClient.SetLabels(request); + lro::Operation response = regionDisksClient.SetLabels(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionDisksClient.PollOnceSetLabels(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -905,7 +1306,23 @@ public async Task SetLabelsRequestObjectAsync() RegionSetLabelsRequestResource = new RegionSetLabelsRequest(), }; // Make the request - Operation response = await regionDisksClient.SetLabelsAsync(request); + lro::Operation response = await regionDisksClient.SetLabelsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionDisksClient.PollOnceSetLabelsAsync(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 } @@ -921,7 +1338,23 @@ public void SetLabels() string resource = ""; RegionSetLabelsRequest regionSetLabelsRequestResource = new RegionSetLabelsRequest(); // Make the request - Operation response = regionDisksClient.SetLabels(project, region, resource, regionSetLabelsRequestResource); + lro::Operation response = regionDisksClient.SetLabels(project, region, resource, regionSetLabelsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionDisksClient.PollOnceSetLabels(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -938,7 +1371,23 @@ public async Task SetLabelsAsync() string resource = ""; RegionSetLabelsRequest regionSetLabelsRequestResource = new RegionSetLabelsRequest(); // Make the request - Operation response = await regionDisksClient.SetLabelsAsync(project, region, resource, regionSetLabelsRequestResource); + lro::Operation response = await regionDisksClient.SetLabelsAsync(project, region, resource, regionSetLabelsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionDisksClient.PollOnceSetLabelsAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionHealthCheckServicesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionHealthCheckServicesClientSnippets.g.cs index 2b7f6ff59d52..e52a488c1cef 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionHealthCheckServicesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionHealthCheckServicesClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedRegionHealthCheckServicesClientSnippets @@ -39,7 +40,23 @@ public void DeleteRequestObject() HealthCheckService = "", }; // Make the request - Operation response = regionHealthCheckServicesClient.Delete(request); + lro::Operation response = regionHealthCheckServicesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionHealthCheckServicesClient.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 } @@ -59,7 +76,23 @@ public async Task DeleteRequestObjectAsync() HealthCheckService = "", }; // Make the request - Operation response = await regionHealthCheckServicesClient.DeleteAsync(request); + lro::Operation response = await regionHealthCheckServicesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionHealthCheckServicesClient.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 } @@ -74,7 +107,23 @@ public void Delete() string region = ""; string healthCheckService = ""; // Make the request - Operation response = regionHealthCheckServicesClient.Delete(project, region, healthCheckService); + lro::Operation response = regionHealthCheckServicesClient.Delete(project, region, healthCheckService); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionHealthCheckServicesClient.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 } @@ -90,7 +139,23 @@ public async Task DeleteAsync() string region = ""; string healthCheckService = ""; // Make the request - Operation response = await regionHealthCheckServicesClient.DeleteAsync(project, region, healthCheckService); + lro::Operation response = await regionHealthCheckServicesClient.DeleteAsync(project, region, healthCheckService); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionHealthCheckServicesClient.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 } @@ -177,7 +242,23 @@ public void InsertRequestObject() HealthCheckServiceResource = new HealthCheckService(), }; // Make the request - Operation response = regionHealthCheckServicesClient.Insert(request); + lro::Operation response = regionHealthCheckServicesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionHealthCheckServicesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -197,7 +278,23 @@ public async Task InsertRequestObjectAsync() HealthCheckServiceResource = new HealthCheckService(), }; // Make the request - Operation response = await regionHealthCheckServicesClient.InsertAsync(request); + lro::Operation response = await regionHealthCheckServicesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionHealthCheckServicesClient.PollOnceInsertAsync(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 } @@ -212,7 +309,23 @@ public void Insert() string region = ""; HealthCheckService healthCheckServiceResource = new HealthCheckService(); // Make the request - Operation response = regionHealthCheckServicesClient.Insert(project, region, healthCheckServiceResource); + lro::Operation response = regionHealthCheckServicesClient.Insert(project, region, healthCheckServiceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionHealthCheckServicesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -228,7 +341,23 @@ public async Task InsertAsync() string region = ""; HealthCheckService healthCheckServiceResource = new HealthCheckService(); // Make the request - Operation response = await regionHealthCheckServicesClient.InsertAsync(project, region, healthCheckServiceResource); + lro::Operation response = await regionHealthCheckServicesClient.InsertAsync(project, region, healthCheckServiceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionHealthCheckServicesClient.PollOnceInsertAsync(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 } @@ -444,7 +573,23 @@ public void PatchRequestObject() HealthCheckServiceResource = new HealthCheckService(), }; // Make the request - Operation response = regionHealthCheckServicesClient.Patch(request); + lro::Operation response = regionHealthCheckServicesClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionHealthCheckServicesClient.PollOncePatch(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 } @@ -465,7 +610,23 @@ public async Task PatchRequestObjectAsync() HealthCheckServiceResource = new HealthCheckService(), }; // Make the request - Operation response = await regionHealthCheckServicesClient.PatchAsync(request); + lro::Operation response = await regionHealthCheckServicesClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionHealthCheckServicesClient.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 } @@ -481,7 +642,23 @@ public void Patch() string healthCheckService = ""; HealthCheckService healthCheckServiceResource = new HealthCheckService(); // Make the request - Operation response = regionHealthCheckServicesClient.Patch(project, region, healthCheckService, healthCheckServiceResource); + lro::Operation response = regionHealthCheckServicesClient.Patch(project, region, healthCheckService, healthCheckServiceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionHealthCheckServicesClient.PollOncePatch(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 } @@ -498,7 +675,23 @@ public async Task PatchAsync() string healthCheckService = ""; HealthCheckService healthCheckServiceResource = new HealthCheckService(); // Make the request - Operation response = await regionHealthCheckServicesClient.PatchAsync(project, region, healthCheckService, healthCheckServiceResource); + lro::Operation response = await regionHealthCheckServicesClient.PatchAsync(project, region, healthCheckService, healthCheckServiceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionHealthCheckServicesClient.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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionHealthChecksClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionHealthChecksClientSnippets.g.cs index 06e2063a7213..951c1ffa76ac 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionHealthChecksClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionHealthChecksClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedRegionHealthChecksClientSnippets @@ -39,7 +40,23 @@ public void DeleteRequestObject() HealthCheck = "", }; // Make the request - Operation response = regionHealthChecksClient.Delete(request); + lro::Operation response = regionHealthChecksClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionHealthChecksClient.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 } @@ -59,7 +76,23 @@ public async Task DeleteRequestObjectAsync() HealthCheck = "", }; // Make the request - Operation response = await regionHealthChecksClient.DeleteAsync(request); + lro::Operation response = await regionHealthChecksClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionHealthChecksClient.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 } @@ -74,7 +107,23 @@ public void Delete() string region = ""; string healthCheck = ""; // Make the request - Operation response = regionHealthChecksClient.Delete(project, region, healthCheck); + lro::Operation response = regionHealthChecksClient.Delete(project, region, healthCheck); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionHealthChecksClient.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 } @@ -90,7 +139,23 @@ public async Task DeleteAsync() string region = ""; string healthCheck = ""; // Make the request - Operation response = await regionHealthChecksClient.DeleteAsync(project, region, healthCheck); + lro::Operation response = await regionHealthChecksClient.DeleteAsync(project, region, healthCheck); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionHealthChecksClient.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 } @@ -177,7 +242,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = regionHealthChecksClient.Insert(request); + lro::Operation response = regionHealthChecksClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionHealthChecksClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -197,7 +278,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await regionHealthChecksClient.InsertAsync(request); + lro::Operation response = await regionHealthChecksClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionHealthChecksClient.PollOnceInsertAsync(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 } @@ -212,7 +309,23 @@ public void Insert() string region = ""; HealthCheck healthCheckResource = new HealthCheck(); // Make the request - Operation response = regionHealthChecksClient.Insert(project, region, healthCheckResource); + lro::Operation response = regionHealthChecksClient.Insert(project, region, healthCheckResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionHealthChecksClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -228,7 +341,23 @@ public async Task InsertAsync() string region = ""; HealthCheck healthCheckResource = new HealthCheck(); // Make the request - Operation response = await regionHealthChecksClient.InsertAsync(project, region, healthCheckResource); + lro::Operation response = await regionHealthChecksClient.InsertAsync(project, region, healthCheckResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionHealthChecksClient.PollOnceInsertAsync(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 } @@ -444,7 +573,23 @@ public void PatchRequestObject() HealthCheck = "", }; // Make the request - Operation response = regionHealthChecksClient.Patch(request); + lro::Operation response = regionHealthChecksClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionHealthChecksClient.PollOncePatch(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 } @@ -465,7 +610,23 @@ public async Task PatchRequestObjectAsync() HealthCheck = "", }; // Make the request - Operation response = await regionHealthChecksClient.PatchAsync(request); + lro::Operation response = await regionHealthChecksClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionHealthChecksClient.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 } @@ -481,7 +642,23 @@ public void Patch() string healthCheck = ""; HealthCheck healthCheckResource = new HealthCheck(); // Make the request - Operation response = regionHealthChecksClient.Patch(project, region, healthCheck, healthCheckResource); + lro::Operation response = regionHealthChecksClient.Patch(project, region, healthCheck, healthCheckResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionHealthChecksClient.PollOncePatch(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 } @@ -498,7 +675,23 @@ public async Task PatchAsync() string healthCheck = ""; HealthCheck healthCheckResource = new HealthCheck(); // Make the request - Operation response = await regionHealthChecksClient.PatchAsync(project, region, healthCheck, healthCheckResource); + lro::Operation response = await regionHealthChecksClient.PatchAsync(project, region, healthCheck, healthCheckResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionHealthChecksClient.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 } @@ -518,7 +711,23 @@ public void UpdateRequestObject() HealthCheck = "", }; // Make the request - Operation response = regionHealthChecksClient.Update(request); + lro::Operation response = regionHealthChecksClient.Update(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionHealthChecksClient.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 } @@ -539,7 +748,23 @@ public async Task UpdateRequestObjectAsync() HealthCheck = "", }; // Make the request - Operation response = await regionHealthChecksClient.UpdateAsync(request); + lro::Operation response = await regionHealthChecksClient.UpdateAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionHealthChecksClient.PollOnceUpdateAsync(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 } @@ -555,7 +780,23 @@ public void Update() string healthCheck = ""; HealthCheck healthCheckResource = new HealthCheck(); // Make the request - Operation response = regionHealthChecksClient.Update(project, region, healthCheck, healthCheckResource); + lro::Operation response = regionHealthChecksClient.Update(project, region, healthCheck, healthCheckResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionHealthChecksClient.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 } @@ -572,7 +813,23 @@ public async Task UpdateAsync() string healthCheck = ""; HealthCheck healthCheckResource = new HealthCheck(); // Make the request - Operation response = await regionHealthChecksClient.UpdateAsync(project, region, healthCheck, healthCheckResource); + lro::Operation response = await regionHealthChecksClient.UpdateAsync(project, region, healthCheck, healthCheckResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionHealthChecksClient.PollOnceUpdateAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionInstanceGroupManagersClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionInstanceGroupManagersClientSnippets.g.cs index ac64febec875..6fff8cfba761 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionInstanceGroupManagersClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionInstanceGroupManagersClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedRegionInstanceGroupManagersClientSnippets @@ -40,7 +41,23 @@ public void AbandonInstancesRequestObject() RegionInstanceGroupManagersAbandonInstancesRequestResource = new RegionInstanceGroupManagersAbandonInstancesRequest(), }; // Make the request - Operation response = regionInstanceGroupManagersClient.AbandonInstances(request); + lro::Operation response = regionInstanceGroupManagersClient.AbandonInstances(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOnceAbandonInstances(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 } @@ -61,7 +78,23 @@ public async Task AbandonInstancesRequestObjectAsync() RegionInstanceGroupManagersAbandonInstancesRequestResource = new RegionInstanceGroupManagersAbandonInstancesRequest(), }; // Make the request - Operation response = await regionInstanceGroupManagersClient.AbandonInstancesAsync(request); + lro::Operation response = await regionInstanceGroupManagersClient.AbandonInstancesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOnceAbandonInstancesAsync(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 } @@ -77,7 +110,23 @@ public void AbandonInstances() string instanceGroupManager = ""; RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = new RegionInstanceGroupManagersAbandonInstancesRequest(); // Make the request - Operation response = regionInstanceGroupManagersClient.AbandonInstances(project, region, instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource); + lro::Operation response = regionInstanceGroupManagersClient.AbandonInstances(project, region, instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOnceAbandonInstances(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 } @@ -94,7 +143,23 @@ public async Task AbandonInstancesAsync() string instanceGroupManager = ""; RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = new RegionInstanceGroupManagersAbandonInstancesRequest(); // Make the request - Operation response = await regionInstanceGroupManagersClient.AbandonInstancesAsync(project, region, instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource); + lro::Operation response = await regionInstanceGroupManagersClient.AbandonInstancesAsync(project, region, instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOnceAbandonInstancesAsync(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 } @@ -113,7 +178,23 @@ public void ApplyUpdatesToInstancesRequestObject() InstanceGroupManager = "", }; // Make the request - Operation response = regionInstanceGroupManagersClient.ApplyUpdatesToInstances(request); + lro::Operation response = regionInstanceGroupManagersClient.ApplyUpdatesToInstances(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOnceApplyUpdatesToInstances(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 } @@ -133,7 +214,23 @@ public async Task ApplyUpdatesToInstancesRequestObjectAsync() InstanceGroupManager = "", }; // Make the request - Operation response = await regionInstanceGroupManagersClient.ApplyUpdatesToInstancesAsync(request); + lro::Operation response = await regionInstanceGroupManagersClient.ApplyUpdatesToInstancesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOnceApplyUpdatesToInstancesAsync(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 } @@ -149,7 +246,23 @@ public void ApplyUpdatesToInstances() string instanceGroupManager = ""; RegionInstanceGroupManagersApplyUpdatesRequest regionInstanceGroupManagersApplyUpdatesRequestResource = new RegionInstanceGroupManagersApplyUpdatesRequest(); // Make the request - Operation response = regionInstanceGroupManagersClient.ApplyUpdatesToInstances(project, region, instanceGroupManager, regionInstanceGroupManagersApplyUpdatesRequestResource); + lro::Operation response = regionInstanceGroupManagersClient.ApplyUpdatesToInstances(project, region, instanceGroupManager, regionInstanceGroupManagersApplyUpdatesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOnceApplyUpdatesToInstances(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 } @@ -166,7 +279,23 @@ public async Task ApplyUpdatesToInstancesAsync() string instanceGroupManager = ""; RegionInstanceGroupManagersApplyUpdatesRequest regionInstanceGroupManagersApplyUpdatesRequestResource = new RegionInstanceGroupManagersApplyUpdatesRequest(); // Make the request - Operation response = await regionInstanceGroupManagersClient.ApplyUpdatesToInstancesAsync(project, region, instanceGroupManager, regionInstanceGroupManagersApplyUpdatesRequestResource); + lro::Operation response = await regionInstanceGroupManagersClient.ApplyUpdatesToInstancesAsync(project, region, instanceGroupManager, regionInstanceGroupManagersApplyUpdatesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOnceApplyUpdatesToInstancesAsync(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 } @@ -186,7 +315,23 @@ public void CreateInstancesRequestObject() RegionInstanceGroupManagersCreateInstancesRequestResource = new RegionInstanceGroupManagersCreateInstancesRequest(), }; // Make the request - Operation response = regionInstanceGroupManagersClient.CreateInstances(request); + lro::Operation response = regionInstanceGroupManagersClient.CreateInstances(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOnceCreateInstances(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 } @@ -207,7 +352,23 @@ public async Task CreateInstancesRequestObjectAsync() RegionInstanceGroupManagersCreateInstancesRequestResource = new RegionInstanceGroupManagersCreateInstancesRequest(), }; // Make the request - Operation response = await regionInstanceGroupManagersClient.CreateInstancesAsync(request); + lro::Operation response = await regionInstanceGroupManagersClient.CreateInstancesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOnceCreateInstancesAsync(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 } @@ -223,7 +384,23 @@ public void CreateInstances() string instanceGroupManager = ""; RegionInstanceGroupManagersCreateInstancesRequest regionInstanceGroupManagersCreateInstancesRequestResource = new RegionInstanceGroupManagersCreateInstancesRequest(); // Make the request - Operation response = regionInstanceGroupManagersClient.CreateInstances(project, region, instanceGroupManager, regionInstanceGroupManagersCreateInstancesRequestResource); + lro::Operation response = regionInstanceGroupManagersClient.CreateInstances(project, region, instanceGroupManager, regionInstanceGroupManagersCreateInstancesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOnceCreateInstances(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 } @@ -240,7 +417,23 @@ public async Task CreateInstancesAsync() string instanceGroupManager = ""; RegionInstanceGroupManagersCreateInstancesRequest regionInstanceGroupManagersCreateInstancesRequestResource = new RegionInstanceGroupManagersCreateInstancesRequest(); // Make the request - Operation response = await regionInstanceGroupManagersClient.CreateInstancesAsync(project, region, instanceGroupManager, regionInstanceGroupManagersCreateInstancesRequestResource); + lro::Operation response = await regionInstanceGroupManagersClient.CreateInstancesAsync(project, region, instanceGroupManager, regionInstanceGroupManagersCreateInstancesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOnceCreateInstancesAsync(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 } @@ -259,7 +452,23 @@ public void DeleteRequestObject() InstanceGroupManager = "", }; // Make the request - Operation response = regionInstanceGroupManagersClient.Delete(request); + lro::Operation response = regionInstanceGroupManagersClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.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 } @@ -279,7 +488,23 @@ public async Task DeleteRequestObjectAsync() InstanceGroupManager = "", }; // Make the request - Operation response = await regionInstanceGroupManagersClient.DeleteAsync(request); + lro::Operation response = await regionInstanceGroupManagersClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.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 } @@ -294,7 +519,23 @@ public void Delete() string region = ""; string instanceGroupManager = ""; // Make the request - Operation response = regionInstanceGroupManagersClient.Delete(project, region, instanceGroupManager); + lro::Operation response = regionInstanceGroupManagersClient.Delete(project, region, instanceGroupManager); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.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 } @@ -310,7 +551,23 @@ public async Task DeleteAsync() string region = ""; string instanceGroupManager = ""; // Make the request - Operation response = await regionInstanceGroupManagersClient.DeleteAsync(project, region, instanceGroupManager); + lro::Operation response = await regionInstanceGroupManagersClient.DeleteAsync(project, region, instanceGroupManager); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.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 } @@ -330,7 +587,23 @@ public void DeleteInstancesRequestObject() RegionInstanceGroupManagersDeleteInstancesRequestResource = new RegionInstanceGroupManagersDeleteInstancesRequest(), }; // Make the request - Operation response = regionInstanceGroupManagersClient.DeleteInstances(request); + lro::Operation response = regionInstanceGroupManagersClient.DeleteInstances(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOnceDeleteInstances(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 } @@ -351,7 +624,23 @@ public async Task DeleteInstancesRequestObjectAsync() RegionInstanceGroupManagersDeleteInstancesRequestResource = new RegionInstanceGroupManagersDeleteInstancesRequest(), }; // Make the request - Operation response = await regionInstanceGroupManagersClient.DeleteInstancesAsync(request); + lro::Operation response = await regionInstanceGroupManagersClient.DeleteInstancesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOnceDeleteInstancesAsync(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 } @@ -367,7 +656,23 @@ public void DeleteInstances() string instanceGroupManager = ""; RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = new RegionInstanceGroupManagersDeleteInstancesRequest(); // Make the request - Operation response = regionInstanceGroupManagersClient.DeleteInstances(project, region, instanceGroupManager, regionInstanceGroupManagersDeleteInstancesRequestResource); + lro::Operation response = regionInstanceGroupManagersClient.DeleteInstances(project, region, instanceGroupManager, regionInstanceGroupManagersDeleteInstancesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOnceDeleteInstances(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 } @@ -384,7 +689,23 @@ public async Task DeleteInstancesAsync() string instanceGroupManager = ""; RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = new RegionInstanceGroupManagersDeleteInstancesRequest(); // Make the request - Operation response = await regionInstanceGroupManagersClient.DeleteInstancesAsync(project, region, instanceGroupManager, regionInstanceGroupManagersDeleteInstancesRequestResource); + lro::Operation response = await regionInstanceGroupManagersClient.DeleteInstancesAsync(project, region, instanceGroupManager, regionInstanceGroupManagersDeleteInstancesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOnceDeleteInstancesAsync(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 } @@ -403,7 +724,23 @@ public void DeletePerInstanceConfigsRequestObject() InstanceGroupManager = "", }; // Make the request - Operation response = regionInstanceGroupManagersClient.DeletePerInstanceConfigs(request); + lro::Operation response = regionInstanceGroupManagersClient.DeletePerInstanceConfigs(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOnceDeletePerInstanceConfigs(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 } @@ -423,7 +760,23 @@ public async Task DeletePerInstanceConfigsRequestObjectAsync() InstanceGroupManager = "", }; // Make the request - Operation response = await regionInstanceGroupManagersClient.DeletePerInstanceConfigsAsync(request); + lro::Operation response = await regionInstanceGroupManagersClient.DeletePerInstanceConfigsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOnceDeletePerInstanceConfigsAsync(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 } @@ -439,7 +792,23 @@ public void DeletePerInstanceConfigs() string instanceGroupManager = ""; RegionInstanceGroupManagerDeleteInstanceConfigReq regionInstanceGroupManagerDeleteInstanceConfigReqResource = new RegionInstanceGroupManagerDeleteInstanceConfigReq(); // Make the request - Operation response = regionInstanceGroupManagersClient.DeletePerInstanceConfigs(project, region, instanceGroupManager, regionInstanceGroupManagerDeleteInstanceConfigReqResource); + lro::Operation response = regionInstanceGroupManagersClient.DeletePerInstanceConfigs(project, region, instanceGroupManager, regionInstanceGroupManagerDeleteInstanceConfigReqResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOnceDeletePerInstanceConfigs(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 } @@ -456,7 +825,23 @@ public async Task DeletePerInstanceConfigsAsync() string instanceGroupManager = ""; RegionInstanceGroupManagerDeleteInstanceConfigReq regionInstanceGroupManagerDeleteInstanceConfigReqResource = new RegionInstanceGroupManagerDeleteInstanceConfigReq(); // Make the request - Operation response = await regionInstanceGroupManagersClient.DeletePerInstanceConfigsAsync(project, region, instanceGroupManager, regionInstanceGroupManagerDeleteInstanceConfigReqResource); + lro::Operation response = await regionInstanceGroupManagersClient.DeletePerInstanceConfigsAsync(project, region, instanceGroupManager, regionInstanceGroupManagerDeleteInstanceConfigReqResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOnceDeletePerInstanceConfigsAsync(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 } @@ -543,7 +928,23 @@ public void InsertRequestObject() InstanceGroupManagerResource = new InstanceGroupManager(), }; // Make the request - Operation response = regionInstanceGroupManagersClient.Insert(request); + lro::Operation response = regionInstanceGroupManagersClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -563,7 +964,23 @@ public async Task InsertRequestObjectAsync() InstanceGroupManagerResource = new InstanceGroupManager(), }; // Make the request - Operation response = await regionInstanceGroupManagersClient.InsertAsync(request); + lro::Operation response = await regionInstanceGroupManagersClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOnceInsertAsync(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 } @@ -578,7 +995,23 @@ public void Insert() string region = ""; InstanceGroupManager instanceGroupManagerResource = new InstanceGroupManager(); // Make the request - Operation response = regionInstanceGroupManagersClient.Insert(project, region, instanceGroupManagerResource); + lro::Operation response = regionInstanceGroupManagersClient.Insert(project, region, instanceGroupManagerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -594,7 +1027,23 @@ public async Task InsertAsync() string region = ""; InstanceGroupManager instanceGroupManagerResource = new InstanceGroupManager(); // Make the request - Operation response = await regionInstanceGroupManagersClient.InsertAsync(project, region, instanceGroupManagerResource); + lro::Operation response = await regionInstanceGroupManagersClient.InsertAsync(project, region, instanceGroupManagerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOnceInsertAsync(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 } @@ -1410,7 +1859,23 @@ public void PatchRequestObject() InstanceGroupManagerResource = new InstanceGroupManager(), }; // Make the request - Operation response = regionInstanceGroupManagersClient.Patch(request); + lro::Operation response = regionInstanceGroupManagersClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOncePatch(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 } @@ -1431,7 +1896,23 @@ public async Task PatchRequestObjectAsync() InstanceGroupManagerResource = new InstanceGroupManager(), }; // Make the request - Operation response = await regionInstanceGroupManagersClient.PatchAsync(request); + lro::Operation response = await regionInstanceGroupManagersClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.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 } @@ -1447,7 +1928,23 @@ public void Patch() string instanceGroupManager = ""; InstanceGroupManager instanceGroupManagerResource = new InstanceGroupManager(); // Make the request - Operation response = regionInstanceGroupManagersClient.Patch(project, region, instanceGroupManager, instanceGroupManagerResource); + lro::Operation response = regionInstanceGroupManagersClient.Patch(project, region, instanceGroupManager, instanceGroupManagerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOncePatch(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 } @@ -1464,7 +1961,23 @@ public async Task PatchAsync() string instanceGroupManager = ""; InstanceGroupManager instanceGroupManagerResource = new InstanceGroupManager(); // Make the request - Operation response = await regionInstanceGroupManagersClient.PatchAsync(project, region, instanceGroupManager, instanceGroupManagerResource); + lro::Operation response = await regionInstanceGroupManagersClient.PatchAsync(project, region, instanceGroupManager, instanceGroupManagerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.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 } @@ -1484,7 +1997,23 @@ public void PatchPerInstanceConfigsRequestObject() InstanceGroupManager = "", }; // Make the request - Operation response = regionInstanceGroupManagersClient.PatchPerInstanceConfigs(request); + lro::Operation response = regionInstanceGroupManagersClient.PatchPerInstanceConfigs(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOncePatchPerInstanceConfigs(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 } @@ -1505,7 +2034,23 @@ public async Task PatchPerInstanceConfigsRequestObjectAsync() InstanceGroupManager = "", }; // Make the request - Operation response = await regionInstanceGroupManagersClient.PatchPerInstanceConfigsAsync(request); + lro::Operation response = await regionInstanceGroupManagersClient.PatchPerInstanceConfigsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOncePatchPerInstanceConfigsAsync(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 } @@ -1521,7 +2066,23 @@ public void PatchPerInstanceConfigs() string instanceGroupManager = ""; RegionInstanceGroupManagerPatchInstanceConfigReq regionInstanceGroupManagerPatchInstanceConfigReqResource = new RegionInstanceGroupManagerPatchInstanceConfigReq(); // Make the request - Operation response = regionInstanceGroupManagersClient.PatchPerInstanceConfigs(project, region, instanceGroupManager, regionInstanceGroupManagerPatchInstanceConfigReqResource); + lro::Operation response = regionInstanceGroupManagersClient.PatchPerInstanceConfigs(project, region, instanceGroupManager, regionInstanceGroupManagerPatchInstanceConfigReqResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOncePatchPerInstanceConfigs(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 } @@ -1538,7 +2099,23 @@ public async Task PatchPerInstanceConfigsAsync() string instanceGroupManager = ""; RegionInstanceGroupManagerPatchInstanceConfigReq regionInstanceGroupManagerPatchInstanceConfigReqResource = new RegionInstanceGroupManagerPatchInstanceConfigReq(); // Make the request - Operation response = await regionInstanceGroupManagersClient.PatchPerInstanceConfigsAsync(project, region, instanceGroupManager, regionInstanceGroupManagerPatchInstanceConfigReqResource); + lro::Operation response = await regionInstanceGroupManagersClient.PatchPerInstanceConfigsAsync(project, region, instanceGroupManager, regionInstanceGroupManagerPatchInstanceConfigReqResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOncePatchPerInstanceConfigsAsync(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 } @@ -1558,7 +2135,23 @@ public void RecreateInstancesRequestObject() InstanceGroupManager = "", }; // Make the request - Operation response = regionInstanceGroupManagersClient.RecreateInstances(request); + lro::Operation response = regionInstanceGroupManagersClient.RecreateInstances(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOnceRecreateInstances(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 } @@ -1579,7 +2172,23 @@ public async Task RecreateInstancesRequestObjectAsync() InstanceGroupManager = "", }; // Make the request - Operation response = await regionInstanceGroupManagersClient.RecreateInstancesAsync(request); + lro::Operation response = await regionInstanceGroupManagersClient.RecreateInstancesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOnceRecreateInstancesAsync(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 } @@ -1595,7 +2204,23 @@ public void RecreateInstances() string instanceGroupManager = ""; RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = new RegionInstanceGroupManagersRecreateRequest(); // Make the request - Operation response = regionInstanceGroupManagersClient.RecreateInstances(project, region, instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource); + lro::Operation response = regionInstanceGroupManagersClient.RecreateInstances(project, region, instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOnceRecreateInstances(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 } @@ -1612,7 +2237,23 @@ public async Task RecreateInstancesAsync() string instanceGroupManager = ""; RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = new RegionInstanceGroupManagersRecreateRequest(); // Make the request - Operation response = await regionInstanceGroupManagersClient.RecreateInstancesAsync(project, region, instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource); + lro::Operation response = await regionInstanceGroupManagersClient.RecreateInstancesAsync(project, region, instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOnceRecreateInstancesAsync(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 } @@ -1632,7 +2273,23 @@ public void ResizeRequestObject() InstanceGroupManager = "", }; // Make the request - Operation response = regionInstanceGroupManagersClient.Resize(request); + lro::Operation response = regionInstanceGroupManagersClient.Resize(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOnceResize(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 } @@ -1653,7 +2310,23 @@ public async Task ResizeRequestObjectAsync() InstanceGroupManager = "", }; // Make the request - Operation response = await regionInstanceGroupManagersClient.ResizeAsync(request); + lro::Operation response = await regionInstanceGroupManagersClient.ResizeAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOnceResizeAsync(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 } @@ -1669,7 +2342,23 @@ public void Resize() string instanceGroupManager = ""; int size = 0; // Make the request - Operation response = regionInstanceGroupManagersClient.Resize(project, region, instanceGroupManager, size); + lro::Operation response = regionInstanceGroupManagersClient.Resize(project, region, instanceGroupManager, size); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOnceResize(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 } @@ -1686,7 +2375,23 @@ public async Task ResizeAsync() string instanceGroupManager = ""; int size = 0; // Make the request - Operation response = await regionInstanceGroupManagersClient.ResizeAsync(project, region, instanceGroupManager, size); + lro::Operation response = await regionInstanceGroupManagersClient.ResizeAsync(project, region, instanceGroupManager, size); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOnceResizeAsync(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 } @@ -1706,7 +2411,23 @@ public void SetInstanceTemplateRequestObject() InstanceGroupManager = "", }; // Make the request - Operation response = regionInstanceGroupManagersClient.SetInstanceTemplate(request); + lro::Operation response = regionInstanceGroupManagersClient.SetInstanceTemplate(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOnceSetInstanceTemplate(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 } @@ -1727,7 +2448,23 @@ public async Task SetInstanceTemplateRequestObjectAsync() InstanceGroupManager = "", }; // Make the request - Operation response = await regionInstanceGroupManagersClient.SetInstanceTemplateAsync(request); + lro::Operation response = await regionInstanceGroupManagersClient.SetInstanceTemplateAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOnceSetInstanceTemplateAsync(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 } @@ -1743,7 +2480,23 @@ public void SetInstanceTemplate() string instanceGroupManager = ""; RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = new RegionInstanceGroupManagersSetTemplateRequest(); // Make the request - Operation response = regionInstanceGroupManagersClient.SetInstanceTemplate(project, region, instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource); + lro::Operation response = regionInstanceGroupManagersClient.SetInstanceTemplate(project, region, instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOnceSetInstanceTemplate(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 } @@ -1760,7 +2513,23 @@ public async Task SetInstanceTemplateAsync() string instanceGroupManager = ""; RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = new RegionInstanceGroupManagersSetTemplateRequest(); // Make the request - Operation response = await regionInstanceGroupManagersClient.SetInstanceTemplateAsync(project, region, instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource); + lro::Operation response = await regionInstanceGroupManagersClient.SetInstanceTemplateAsync(project, region, instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOnceSetInstanceTemplateAsync(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 } @@ -1780,7 +2549,23 @@ public void SetTargetPoolsRequestObject() InstanceGroupManager = "", }; // Make the request - Operation response = regionInstanceGroupManagersClient.SetTargetPools(request); + lro::Operation response = regionInstanceGroupManagersClient.SetTargetPools(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOnceSetTargetPools(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 } @@ -1801,7 +2586,23 @@ public async Task SetTargetPoolsRequestObjectAsync() InstanceGroupManager = "", }; // Make the request - Operation response = await regionInstanceGroupManagersClient.SetTargetPoolsAsync(request); + lro::Operation response = await regionInstanceGroupManagersClient.SetTargetPoolsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOnceSetTargetPoolsAsync(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 } @@ -1817,7 +2618,23 @@ public void SetTargetPools() string instanceGroupManager = ""; RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = new RegionInstanceGroupManagersSetTargetPoolsRequest(); // Make the request - Operation response = regionInstanceGroupManagersClient.SetTargetPools(project, region, instanceGroupManager, regionInstanceGroupManagersSetTargetPoolsRequestResource); + lro::Operation response = regionInstanceGroupManagersClient.SetTargetPools(project, region, instanceGroupManager, regionInstanceGroupManagersSetTargetPoolsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOnceSetTargetPools(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 } @@ -1834,7 +2651,23 @@ public async Task SetTargetPoolsAsync() string instanceGroupManager = ""; RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = new RegionInstanceGroupManagersSetTargetPoolsRequest(); // Make the request - Operation response = await regionInstanceGroupManagersClient.SetTargetPoolsAsync(project, region, instanceGroupManager, regionInstanceGroupManagersSetTargetPoolsRequestResource); + lro::Operation response = await regionInstanceGroupManagersClient.SetTargetPoolsAsync(project, region, instanceGroupManager, regionInstanceGroupManagersSetTargetPoolsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOnceSetTargetPoolsAsync(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 } @@ -1854,7 +2687,23 @@ public void UpdatePerInstanceConfigsRequestObject() InstanceGroupManager = "", }; // Make the request - Operation response = regionInstanceGroupManagersClient.UpdatePerInstanceConfigs(request); + lro::Operation response = regionInstanceGroupManagersClient.UpdatePerInstanceConfigs(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOnceUpdatePerInstanceConfigs(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 } @@ -1875,7 +2724,23 @@ public async Task UpdatePerInstanceConfigsRequestObjectAsync() InstanceGroupManager = "", }; // Make the request - Operation response = await regionInstanceGroupManagersClient.UpdatePerInstanceConfigsAsync(request); + lro::Operation response = await regionInstanceGroupManagersClient.UpdatePerInstanceConfigsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOnceUpdatePerInstanceConfigsAsync(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 } @@ -1891,7 +2756,23 @@ public void UpdatePerInstanceConfigs() string instanceGroupManager = ""; RegionInstanceGroupManagerUpdateInstanceConfigReq regionInstanceGroupManagerUpdateInstanceConfigReqResource = new RegionInstanceGroupManagerUpdateInstanceConfigReq(); // Make the request - Operation response = regionInstanceGroupManagersClient.UpdatePerInstanceConfigs(project, region, instanceGroupManager, regionInstanceGroupManagerUpdateInstanceConfigReqResource); + lro::Operation response = regionInstanceGroupManagersClient.UpdatePerInstanceConfigs(project, region, instanceGroupManager, regionInstanceGroupManagerUpdateInstanceConfigReqResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupManagersClient.PollOnceUpdatePerInstanceConfigs(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 } @@ -1908,7 +2789,23 @@ public async Task UpdatePerInstanceConfigsAsync() string instanceGroupManager = ""; RegionInstanceGroupManagerUpdateInstanceConfigReq regionInstanceGroupManagerUpdateInstanceConfigReqResource = new RegionInstanceGroupManagerUpdateInstanceConfigReq(); // Make the request - Operation response = await regionInstanceGroupManagersClient.UpdatePerInstanceConfigsAsync(project, region, instanceGroupManager, regionInstanceGroupManagerUpdateInstanceConfigReqResource); + lro::Operation response = await regionInstanceGroupManagersClient.UpdatePerInstanceConfigsAsync(project, region, instanceGroupManager, regionInstanceGroupManagerUpdateInstanceConfigReqResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupManagersClient.PollOnceUpdatePerInstanceConfigsAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionInstanceGroupsClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionInstanceGroupsClientSnippets.g.cs index bcfa8acf7267..5d75448fee57 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionInstanceGroupsClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionInstanceGroupsClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedRegionInstanceGroupsClientSnippets @@ -508,7 +509,23 @@ public void SetNamedPortsRequestObject() Project = "", }; // Make the request - Operation response = regionInstanceGroupsClient.SetNamedPorts(request); + lro::Operation response = regionInstanceGroupsClient.SetNamedPorts(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupsClient.PollOnceSetNamedPorts(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 } @@ -529,7 +546,23 @@ public async Task SetNamedPortsRequestObjectAsync() Project = "", }; // Make the request - Operation response = await regionInstanceGroupsClient.SetNamedPortsAsync(request); + lro::Operation response = await regionInstanceGroupsClient.SetNamedPortsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupsClient.PollOnceSetNamedPortsAsync(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 } @@ -545,7 +578,23 @@ public void SetNamedPorts() string instanceGroup = ""; RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = new RegionInstanceGroupsSetNamedPortsRequest(); // Make the request - Operation response = regionInstanceGroupsClient.SetNamedPorts(project, region, instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource); + lro::Operation response = regionInstanceGroupsClient.SetNamedPorts(project, region, instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstanceGroupsClient.PollOnceSetNamedPorts(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 } @@ -562,7 +611,23 @@ public async Task SetNamedPortsAsync() string instanceGroup = ""; RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = new RegionInstanceGroupsSetNamedPortsRequest(); // Make the request - Operation response = await regionInstanceGroupsClient.SetNamedPortsAsync(project, region, instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource); + lro::Operation response = await regionInstanceGroupsClient.SetNamedPortsAsync(project, region, instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstanceGroupsClient.PollOnceSetNamedPortsAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionInstancesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionInstancesClientSnippets.g.cs index eda9e4232686..3ae8799ecbf4 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionInstancesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionInstancesClientSnippets.g.cs @@ -17,6 +17,7 @@ namespace Google.Cloud.Compute.V1.Snippets { using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedRegionInstancesClientSnippets @@ -36,7 +37,23 @@ public void BulkInsertRequestObject() Project = "", }; // Make the request - Operation response = regionInstancesClient.BulkInsert(request); + lro::Operation response = regionInstancesClient.BulkInsert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstancesClient.PollOnceBulkInsert(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 } @@ -56,7 +73,23 @@ public async Task BulkInsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await regionInstancesClient.BulkInsertAsync(request); + lro::Operation response = await regionInstancesClient.BulkInsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstancesClient.PollOnceBulkInsertAsync(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 } @@ -71,7 +104,23 @@ public void BulkInsert() string region = ""; BulkInsertInstanceResource bulkInsertInstanceResourceResource = new BulkInsertInstanceResource(); // Make the request - Operation response = regionInstancesClient.BulkInsert(project, region, bulkInsertInstanceResourceResource); + lro::Operation response = regionInstancesClient.BulkInsert(project, region, bulkInsertInstanceResourceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionInstancesClient.PollOnceBulkInsert(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 } @@ -87,7 +136,23 @@ public async Task BulkInsertAsync() string region = ""; BulkInsertInstanceResource bulkInsertInstanceResourceResource = new BulkInsertInstanceResource(); // Make the request - Operation response = await regionInstancesClient.BulkInsertAsync(project, region, bulkInsertInstanceResourceResource); + lro::Operation response = await regionInstancesClient.BulkInsertAsync(project, region, bulkInsertInstanceResourceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionInstancesClient.PollOnceBulkInsertAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionNetworkEndpointGroupsClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionNetworkEndpointGroupsClientSnippets.g.cs index 662d8514e3b0..66db57e75a6a 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionNetworkEndpointGroupsClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionNetworkEndpointGroupsClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedRegionNetworkEndpointGroupsClientSnippets @@ -39,7 +40,23 @@ public void DeleteRequestObject() NetworkEndpointGroup = "", }; // Make the request - Operation response = regionNetworkEndpointGroupsClient.Delete(request); + lro::Operation response = regionNetworkEndpointGroupsClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionNetworkEndpointGroupsClient.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 } @@ -59,7 +76,23 @@ public async Task DeleteRequestObjectAsync() NetworkEndpointGroup = "", }; // Make the request - Operation response = await regionNetworkEndpointGroupsClient.DeleteAsync(request); + lro::Operation response = await regionNetworkEndpointGroupsClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionNetworkEndpointGroupsClient.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 } @@ -74,7 +107,23 @@ public void Delete() string region = ""; string networkEndpointGroup = ""; // Make the request - Operation response = regionNetworkEndpointGroupsClient.Delete(project, region, networkEndpointGroup); + lro::Operation response = regionNetworkEndpointGroupsClient.Delete(project, region, networkEndpointGroup); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionNetworkEndpointGroupsClient.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 } @@ -90,7 +139,23 @@ public async Task DeleteAsync() string region = ""; string networkEndpointGroup = ""; // Make the request - Operation response = await regionNetworkEndpointGroupsClient.DeleteAsync(project, region, networkEndpointGroup); + lro::Operation response = await regionNetworkEndpointGroupsClient.DeleteAsync(project, region, networkEndpointGroup); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionNetworkEndpointGroupsClient.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 } @@ -177,7 +242,23 @@ public void InsertRequestObject() NetworkEndpointGroupResource = new NetworkEndpointGroup(), }; // Make the request - Operation response = regionNetworkEndpointGroupsClient.Insert(request); + lro::Operation response = regionNetworkEndpointGroupsClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionNetworkEndpointGroupsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -197,7 +278,23 @@ public async Task InsertRequestObjectAsync() NetworkEndpointGroupResource = new NetworkEndpointGroup(), }; // Make the request - Operation response = await regionNetworkEndpointGroupsClient.InsertAsync(request); + lro::Operation response = await regionNetworkEndpointGroupsClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionNetworkEndpointGroupsClient.PollOnceInsertAsync(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 } @@ -212,7 +309,23 @@ public void Insert() string region = ""; NetworkEndpointGroup networkEndpointGroupResource = new NetworkEndpointGroup(); // Make the request - Operation response = regionNetworkEndpointGroupsClient.Insert(project, region, networkEndpointGroupResource); + lro::Operation response = regionNetworkEndpointGroupsClient.Insert(project, region, networkEndpointGroupResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionNetworkEndpointGroupsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -228,7 +341,23 @@ public async Task InsertAsync() string region = ""; NetworkEndpointGroup networkEndpointGroupResource = new NetworkEndpointGroup(); // Make the request - Operation response = await regionNetworkEndpointGroupsClient.InsertAsync(project, region, networkEndpointGroupResource); + lro::Operation response = await regionNetworkEndpointGroupsClient.InsertAsync(project, region, networkEndpointGroupResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionNetworkEndpointGroupsClient.PollOnceInsertAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionNotificationEndpointsClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionNotificationEndpointsClientSnippets.g.cs index f72d428903d7..6411007ff8b5 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionNotificationEndpointsClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionNotificationEndpointsClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedRegionNotificationEndpointsClientSnippets @@ -39,7 +40,23 @@ public void DeleteRequestObject() NotificationEndpoint = "", }; // Make the request - Operation response = regionNotificationEndpointsClient.Delete(request); + lro::Operation response = regionNotificationEndpointsClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionNotificationEndpointsClient.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 } @@ -59,7 +76,23 @@ public async Task DeleteRequestObjectAsync() NotificationEndpoint = "", }; // Make the request - Operation response = await regionNotificationEndpointsClient.DeleteAsync(request); + lro::Operation response = await regionNotificationEndpointsClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionNotificationEndpointsClient.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 } @@ -74,7 +107,23 @@ public void Delete() string region = ""; string notificationEndpoint = ""; // Make the request - Operation response = regionNotificationEndpointsClient.Delete(project, region, notificationEndpoint); + lro::Operation response = regionNotificationEndpointsClient.Delete(project, region, notificationEndpoint); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionNotificationEndpointsClient.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 } @@ -90,7 +139,23 @@ public async Task DeleteAsync() string region = ""; string notificationEndpoint = ""; // Make the request - Operation response = await regionNotificationEndpointsClient.DeleteAsync(project, region, notificationEndpoint); + lro::Operation response = await regionNotificationEndpointsClient.DeleteAsync(project, region, notificationEndpoint); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionNotificationEndpointsClient.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 } @@ -177,7 +242,23 @@ public void InsertRequestObject() NotificationEndpointResource = new NotificationEndpoint(), }; // Make the request - Operation response = regionNotificationEndpointsClient.Insert(request); + lro::Operation response = regionNotificationEndpointsClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionNotificationEndpointsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -197,7 +278,23 @@ public async Task InsertRequestObjectAsync() NotificationEndpointResource = new NotificationEndpoint(), }; // Make the request - Operation response = await regionNotificationEndpointsClient.InsertAsync(request); + lro::Operation response = await regionNotificationEndpointsClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionNotificationEndpointsClient.PollOnceInsertAsync(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 } @@ -212,7 +309,23 @@ public void Insert() string region = ""; NotificationEndpoint notificationEndpointResource = new NotificationEndpoint(); // Make the request - Operation response = regionNotificationEndpointsClient.Insert(project, region, notificationEndpointResource); + lro::Operation response = regionNotificationEndpointsClient.Insert(project, region, notificationEndpointResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionNotificationEndpointsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -228,7 +341,23 @@ public async Task InsertAsync() string region = ""; NotificationEndpoint notificationEndpointResource = new NotificationEndpoint(); // Make the request - Operation response = await regionNotificationEndpointsClient.InsertAsync(project, region, notificationEndpointResource); + lro::Operation response = await regionNotificationEndpointsClient.InsertAsync(project, region, notificationEndpointResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionNotificationEndpointsClient.PollOnceInsertAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionSslCertificatesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionSslCertificatesClientSnippets.g.cs index b4b06cfc71fe..be5d38e964c7 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionSslCertificatesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionSslCertificatesClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedRegionSslCertificatesClientSnippets @@ -39,7 +40,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = regionSslCertificatesClient.Delete(request); + lro::Operation response = regionSslCertificatesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionSslCertificatesClient.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 } @@ -59,7 +76,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await regionSslCertificatesClient.DeleteAsync(request); + lro::Operation response = await regionSslCertificatesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionSslCertificatesClient.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 } @@ -74,7 +107,23 @@ public void Delete() string region = ""; string sslCertificate = ""; // Make the request - Operation response = regionSslCertificatesClient.Delete(project, region, sslCertificate); + lro::Operation response = regionSslCertificatesClient.Delete(project, region, sslCertificate); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionSslCertificatesClient.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 } @@ -90,7 +139,23 @@ public async Task DeleteAsync() string region = ""; string sslCertificate = ""; // Make the request - Operation response = await regionSslCertificatesClient.DeleteAsync(project, region, sslCertificate); + lro::Operation response = await regionSslCertificatesClient.DeleteAsync(project, region, sslCertificate); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionSslCertificatesClient.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 } @@ -177,7 +242,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = regionSslCertificatesClient.Insert(request); + lro::Operation response = regionSslCertificatesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionSslCertificatesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -197,7 +278,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await regionSslCertificatesClient.InsertAsync(request); + lro::Operation response = await regionSslCertificatesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionSslCertificatesClient.PollOnceInsertAsync(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 } @@ -212,7 +309,23 @@ public void Insert() string region = ""; SslCertificate sslCertificateResource = new SslCertificate(); // Make the request - Operation response = regionSslCertificatesClient.Insert(project, region, sslCertificateResource); + lro::Operation response = regionSslCertificatesClient.Insert(project, region, sslCertificateResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionSslCertificatesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -228,7 +341,23 @@ public async Task InsertAsync() string region = ""; SslCertificate sslCertificateResource = new SslCertificate(); // Make the request - Operation response = await regionSslCertificatesClient.InsertAsync(project, region, sslCertificateResource); + lro::Operation response = await regionSslCertificatesClient.InsertAsync(project, region, sslCertificateResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionSslCertificatesClient.PollOnceInsertAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionTargetHttpProxiesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionTargetHttpProxiesClientSnippets.g.cs index 193a45a89fd6..89a6f6969678 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionTargetHttpProxiesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionTargetHttpProxiesClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedRegionTargetHttpProxiesClientSnippets @@ -39,7 +40,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = regionTargetHttpProxiesClient.Delete(request); + lro::Operation response = regionTargetHttpProxiesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionTargetHttpProxiesClient.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 } @@ -59,7 +76,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await regionTargetHttpProxiesClient.DeleteAsync(request); + lro::Operation response = await regionTargetHttpProxiesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionTargetHttpProxiesClient.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 } @@ -74,7 +107,23 @@ public void Delete() string region = ""; string targetHttpProxy = ""; // Make the request - Operation response = regionTargetHttpProxiesClient.Delete(project, region, targetHttpProxy); + lro::Operation response = regionTargetHttpProxiesClient.Delete(project, region, targetHttpProxy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionTargetHttpProxiesClient.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 } @@ -90,7 +139,23 @@ public async Task DeleteAsync() string region = ""; string targetHttpProxy = ""; // Make the request - Operation response = await regionTargetHttpProxiesClient.DeleteAsync(project, region, targetHttpProxy); + lro::Operation response = await regionTargetHttpProxiesClient.DeleteAsync(project, region, targetHttpProxy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionTargetHttpProxiesClient.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 } @@ -177,7 +242,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = regionTargetHttpProxiesClient.Insert(request); + lro::Operation response = regionTargetHttpProxiesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionTargetHttpProxiesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -197,7 +278,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await regionTargetHttpProxiesClient.InsertAsync(request); + lro::Operation response = await regionTargetHttpProxiesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionTargetHttpProxiesClient.PollOnceInsertAsync(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 } @@ -212,7 +309,23 @@ public void Insert() string region = ""; TargetHttpProxy targetHttpProxyResource = new TargetHttpProxy(); // Make the request - Operation response = regionTargetHttpProxiesClient.Insert(project, region, targetHttpProxyResource); + lro::Operation response = regionTargetHttpProxiesClient.Insert(project, region, targetHttpProxyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionTargetHttpProxiesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -228,7 +341,23 @@ public async Task InsertAsync() string region = ""; TargetHttpProxy targetHttpProxyResource = new TargetHttpProxy(); // Make the request - Operation response = await regionTargetHttpProxiesClient.InsertAsync(project, region, targetHttpProxyResource); + lro::Operation response = await regionTargetHttpProxiesClient.InsertAsync(project, region, targetHttpProxyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionTargetHttpProxiesClient.PollOnceInsertAsync(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 } @@ -444,7 +573,23 @@ public void SetUrlMapRequestObject() UrlMapReferenceResource = new UrlMapReference(), }; // Make the request - Operation response = regionTargetHttpProxiesClient.SetUrlMap(request); + lro::Operation response = regionTargetHttpProxiesClient.SetUrlMap(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionTargetHttpProxiesClient.PollOnceSetUrlMap(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 } @@ -465,7 +610,23 @@ public async Task SetUrlMapRequestObjectAsync() UrlMapReferenceResource = new UrlMapReference(), }; // Make the request - Operation response = await regionTargetHttpProxiesClient.SetUrlMapAsync(request); + lro::Operation response = await regionTargetHttpProxiesClient.SetUrlMapAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionTargetHttpProxiesClient.PollOnceSetUrlMapAsync(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 } @@ -481,7 +642,23 @@ public void SetUrlMap() string targetHttpProxy = ""; UrlMapReference urlMapReferenceResource = new UrlMapReference(); // Make the request - Operation response = regionTargetHttpProxiesClient.SetUrlMap(project, region, targetHttpProxy, urlMapReferenceResource); + lro::Operation response = regionTargetHttpProxiesClient.SetUrlMap(project, region, targetHttpProxy, urlMapReferenceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionTargetHttpProxiesClient.PollOnceSetUrlMap(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 } @@ -498,7 +675,23 @@ public async Task SetUrlMapAsync() string targetHttpProxy = ""; UrlMapReference urlMapReferenceResource = new UrlMapReference(); // Make the request - Operation response = await regionTargetHttpProxiesClient.SetUrlMapAsync(project, region, targetHttpProxy, urlMapReferenceResource); + lro::Operation response = await regionTargetHttpProxiesClient.SetUrlMapAsync(project, region, targetHttpProxy, urlMapReferenceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionTargetHttpProxiesClient.PollOnceSetUrlMapAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionTargetHttpsProxiesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionTargetHttpsProxiesClientSnippets.g.cs index 81f358cbca82..03962707cb44 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionTargetHttpsProxiesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionTargetHttpsProxiesClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedRegionTargetHttpsProxiesClientSnippets @@ -39,7 +40,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = regionTargetHttpsProxiesClient.Delete(request); + lro::Operation response = regionTargetHttpsProxiesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionTargetHttpsProxiesClient.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 } @@ -59,7 +76,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await regionTargetHttpsProxiesClient.DeleteAsync(request); + lro::Operation response = await regionTargetHttpsProxiesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionTargetHttpsProxiesClient.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 } @@ -74,7 +107,23 @@ public void Delete() string region = ""; string targetHttpsProxy = ""; // Make the request - Operation response = regionTargetHttpsProxiesClient.Delete(project, region, targetHttpsProxy); + lro::Operation response = regionTargetHttpsProxiesClient.Delete(project, region, targetHttpsProxy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionTargetHttpsProxiesClient.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 } @@ -90,7 +139,23 @@ public async Task DeleteAsync() string region = ""; string targetHttpsProxy = ""; // Make the request - Operation response = await regionTargetHttpsProxiesClient.DeleteAsync(project, region, targetHttpsProxy); + lro::Operation response = await regionTargetHttpsProxiesClient.DeleteAsync(project, region, targetHttpsProxy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionTargetHttpsProxiesClient.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 } @@ -177,7 +242,23 @@ public void InsertRequestObject() TargetHttpsProxyResource = new TargetHttpsProxy(), }; // Make the request - Operation response = regionTargetHttpsProxiesClient.Insert(request); + lro::Operation response = regionTargetHttpsProxiesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionTargetHttpsProxiesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -197,7 +278,23 @@ public async Task InsertRequestObjectAsync() TargetHttpsProxyResource = new TargetHttpsProxy(), }; // Make the request - Operation response = await regionTargetHttpsProxiesClient.InsertAsync(request); + lro::Operation response = await regionTargetHttpsProxiesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionTargetHttpsProxiesClient.PollOnceInsertAsync(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 } @@ -212,7 +309,23 @@ public void Insert() string region = ""; TargetHttpsProxy targetHttpsProxyResource = new TargetHttpsProxy(); // Make the request - Operation response = regionTargetHttpsProxiesClient.Insert(project, region, targetHttpsProxyResource); + lro::Operation response = regionTargetHttpsProxiesClient.Insert(project, region, targetHttpsProxyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionTargetHttpsProxiesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -228,7 +341,23 @@ public async Task InsertAsync() string region = ""; TargetHttpsProxy targetHttpsProxyResource = new TargetHttpsProxy(); // Make the request - Operation response = await regionTargetHttpsProxiesClient.InsertAsync(project, region, targetHttpsProxyResource); + lro::Operation response = await regionTargetHttpsProxiesClient.InsertAsync(project, region, targetHttpsProxyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionTargetHttpsProxiesClient.PollOnceInsertAsync(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 } @@ -444,7 +573,23 @@ public void SetSslCertificatesRequestObject() RegionTargetHttpsProxiesSetSslCertificatesRequestResource = new RegionTargetHttpsProxiesSetSslCertificatesRequest(), }; // Make the request - Operation response = regionTargetHttpsProxiesClient.SetSslCertificates(request); + lro::Operation response = regionTargetHttpsProxiesClient.SetSslCertificates(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionTargetHttpsProxiesClient.PollOnceSetSslCertificates(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 } @@ -465,7 +610,23 @@ public async Task SetSslCertificatesRequestObjectAsync() RegionTargetHttpsProxiesSetSslCertificatesRequestResource = new RegionTargetHttpsProxiesSetSslCertificatesRequest(), }; // Make the request - Operation response = await regionTargetHttpsProxiesClient.SetSslCertificatesAsync(request); + lro::Operation response = await regionTargetHttpsProxiesClient.SetSslCertificatesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionTargetHttpsProxiesClient.PollOnceSetSslCertificatesAsync(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 } @@ -481,7 +642,23 @@ public void SetSslCertificates() string targetHttpsProxy = ""; RegionTargetHttpsProxiesSetSslCertificatesRequest regionTargetHttpsProxiesSetSslCertificatesRequestResource = new RegionTargetHttpsProxiesSetSslCertificatesRequest(); // Make the request - Operation response = regionTargetHttpsProxiesClient.SetSslCertificates(project, region, targetHttpsProxy, regionTargetHttpsProxiesSetSslCertificatesRequestResource); + lro::Operation response = regionTargetHttpsProxiesClient.SetSslCertificates(project, region, targetHttpsProxy, regionTargetHttpsProxiesSetSslCertificatesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionTargetHttpsProxiesClient.PollOnceSetSslCertificates(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 } @@ -498,7 +675,23 @@ public async Task SetSslCertificatesAsync() string targetHttpsProxy = ""; RegionTargetHttpsProxiesSetSslCertificatesRequest regionTargetHttpsProxiesSetSslCertificatesRequestResource = new RegionTargetHttpsProxiesSetSslCertificatesRequest(); // Make the request - Operation response = await regionTargetHttpsProxiesClient.SetSslCertificatesAsync(project, region, targetHttpsProxy, regionTargetHttpsProxiesSetSslCertificatesRequestResource); + lro::Operation response = await regionTargetHttpsProxiesClient.SetSslCertificatesAsync(project, region, targetHttpsProxy, regionTargetHttpsProxiesSetSslCertificatesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionTargetHttpsProxiesClient.PollOnceSetSslCertificatesAsync(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 } @@ -518,7 +711,23 @@ public void SetUrlMapRequestObject() UrlMapReferenceResource = new UrlMapReference(), }; // Make the request - Operation response = regionTargetHttpsProxiesClient.SetUrlMap(request); + lro::Operation response = regionTargetHttpsProxiesClient.SetUrlMap(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionTargetHttpsProxiesClient.PollOnceSetUrlMap(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 } @@ -539,7 +748,23 @@ public async Task SetUrlMapRequestObjectAsync() UrlMapReferenceResource = new UrlMapReference(), }; // Make the request - Operation response = await regionTargetHttpsProxiesClient.SetUrlMapAsync(request); + lro::Operation response = await regionTargetHttpsProxiesClient.SetUrlMapAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionTargetHttpsProxiesClient.PollOnceSetUrlMapAsync(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 } @@ -555,7 +780,23 @@ public void SetUrlMap() string targetHttpsProxy = ""; UrlMapReference urlMapReferenceResource = new UrlMapReference(); // Make the request - Operation response = regionTargetHttpsProxiesClient.SetUrlMap(project, region, targetHttpsProxy, urlMapReferenceResource); + lro::Operation response = regionTargetHttpsProxiesClient.SetUrlMap(project, region, targetHttpsProxy, urlMapReferenceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionTargetHttpsProxiesClient.PollOnceSetUrlMap(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 } @@ -572,7 +813,23 @@ public async Task SetUrlMapAsync() string targetHttpsProxy = ""; UrlMapReference urlMapReferenceResource = new UrlMapReference(); // Make the request - Operation response = await regionTargetHttpsProxiesClient.SetUrlMapAsync(project, region, targetHttpsProxy, urlMapReferenceResource); + lro::Operation response = await regionTargetHttpsProxiesClient.SetUrlMapAsync(project, region, targetHttpsProxy, urlMapReferenceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionTargetHttpsProxiesClient.PollOnceSetUrlMapAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionUrlMapsClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionUrlMapsClientSnippets.g.cs index b26a879b78ce..705c4de2ab22 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionUrlMapsClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RegionUrlMapsClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedRegionUrlMapsClientSnippets @@ -39,7 +40,23 @@ public void DeleteRequestObject() UrlMap = "", }; // Make the request - Operation response = regionUrlMapsClient.Delete(request); + lro::Operation response = regionUrlMapsClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionUrlMapsClient.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 } @@ -59,7 +76,23 @@ public async Task DeleteRequestObjectAsync() UrlMap = "", }; // Make the request - Operation response = await regionUrlMapsClient.DeleteAsync(request); + lro::Operation response = await regionUrlMapsClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionUrlMapsClient.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 } @@ -74,7 +107,23 @@ public void Delete() string region = ""; string urlMap = ""; // Make the request - Operation response = regionUrlMapsClient.Delete(project, region, urlMap); + lro::Operation response = regionUrlMapsClient.Delete(project, region, urlMap); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionUrlMapsClient.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 } @@ -90,7 +139,23 @@ public async Task DeleteAsync() string region = ""; string urlMap = ""; // Make the request - Operation response = await regionUrlMapsClient.DeleteAsync(project, region, urlMap); + lro::Operation response = await regionUrlMapsClient.DeleteAsync(project, region, urlMap); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionUrlMapsClient.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 } @@ -177,7 +242,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = regionUrlMapsClient.Insert(request); + lro::Operation response = regionUrlMapsClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionUrlMapsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -197,7 +278,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await regionUrlMapsClient.InsertAsync(request); + lro::Operation response = await regionUrlMapsClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionUrlMapsClient.PollOnceInsertAsync(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 } @@ -212,7 +309,23 @@ public void Insert() string region = ""; UrlMap urlMapResource = new UrlMap(); // Make the request - Operation response = regionUrlMapsClient.Insert(project, region, urlMapResource); + lro::Operation response = regionUrlMapsClient.Insert(project, region, urlMapResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionUrlMapsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -228,7 +341,23 @@ public async Task InsertAsync() string region = ""; UrlMap urlMapResource = new UrlMap(); // Make the request - Operation response = await regionUrlMapsClient.InsertAsync(project, region, urlMapResource); + lro::Operation response = await regionUrlMapsClient.InsertAsync(project, region, urlMapResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionUrlMapsClient.PollOnceInsertAsync(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 } @@ -444,7 +573,23 @@ public void PatchRequestObject() UrlMap = "", }; // Make the request - Operation response = regionUrlMapsClient.Patch(request); + lro::Operation response = regionUrlMapsClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionUrlMapsClient.PollOncePatch(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 } @@ -465,7 +610,23 @@ public async Task PatchRequestObjectAsync() UrlMap = "", }; // Make the request - Operation response = await regionUrlMapsClient.PatchAsync(request); + lro::Operation response = await regionUrlMapsClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionUrlMapsClient.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 } @@ -481,7 +642,23 @@ public void Patch() string urlMap = ""; UrlMap urlMapResource = new UrlMap(); // Make the request - Operation response = regionUrlMapsClient.Patch(project, region, urlMap, urlMapResource); + lro::Operation response = regionUrlMapsClient.Patch(project, region, urlMap, urlMapResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionUrlMapsClient.PollOncePatch(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 } @@ -498,7 +675,23 @@ public async Task PatchAsync() string urlMap = ""; UrlMap urlMapResource = new UrlMap(); // Make the request - Operation response = await regionUrlMapsClient.PatchAsync(project, region, urlMap, urlMapResource); + lro::Operation response = await regionUrlMapsClient.PatchAsync(project, region, urlMap, urlMapResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionUrlMapsClient.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 } @@ -518,7 +711,23 @@ public void UpdateRequestObject() UrlMap = "", }; // Make the request - Operation response = regionUrlMapsClient.Update(request); + lro::Operation response = regionUrlMapsClient.Update(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionUrlMapsClient.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 } @@ -539,7 +748,23 @@ public async Task UpdateRequestObjectAsync() UrlMap = "", }; // Make the request - Operation response = await regionUrlMapsClient.UpdateAsync(request); + lro::Operation response = await regionUrlMapsClient.UpdateAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionUrlMapsClient.PollOnceUpdateAsync(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 } @@ -555,7 +780,23 @@ public void Update() string urlMap = ""; UrlMap urlMapResource = new UrlMap(); // Make the request - Operation response = regionUrlMapsClient.Update(project, region, urlMap, urlMapResource); + lro::Operation response = regionUrlMapsClient.Update(project, region, urlMap, urlMapResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = regionUrlMapsClient.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 } @@ -572,7 +813,23 @@ public async Task UpdateAsync() string urlMap = ""; UrlMap urlMapResource = new UrlMap(); // Make the request - Operation response = await regionUrlMapsClient.UpdateAsync(project, region, urlMap, urlMapResource); + lro::Operation response = await regionUrlMapsClient.UpdateAsync(project, region, urlMap, urlMapResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await regionUrlMapsClient.PollOnceUpdateAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ReservationsClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ReservationsClientSnippets.g.cs index 5ff8fae8f566..91fdd2de2a1a 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ReservationsClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ReservationsClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedReservationsClientSnippets @@ -234,7 +235,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = reservationsClient.Delete(request); + lro::Operation response = reservationsClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = reservationsClient.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 } @@ -254,7 +271,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await reservationsClient.DeleteAsync(request); + lro::Operation response = await reservationsClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await reservationsClient.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 } @@ -269,7 +302,23 @@ public void Delete() string zone = ""; string reservation = ""; // Make the request - Operation response = reservationsClient.Delete(project, zone, reservation); + lro::Operation response = reservationsClient.Delete(project, zone, reservation); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = reservationsClient.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 } @@ -285,7 +334,23 @@ public async Task DeleteAsync() string zone = ""; string reservation = ""; // Make the request - Operation response = await reservationsClient.DeleteAsync(project, zone, reservation); + lro::Operation response = await reservationsClient.DeleteAsync(project, zone, reservation); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await reservationsClient.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 } @@ -442,7 +507,23 @@ public void InsertRequestObject() ReservationResource = new Reservation(), }; // Make the request - Operation response = reservationsClient.Insert(request); + lro::Operation response = reservationsClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = reservationsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -462,7 +543,23 @@ public async Task InsertRequestObjectAsync() ReservationResource = new Reservation(), }; // Make the request - Operation response = await reservationsClient.InsertAsync(request); + lro::Operation response = await reservationsClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await reservationsClient.PollOnceInsertAsync(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 } @@ -477,7 +574,23 @@ public void Insert() string zone = ""; Reservation reservationResource = new Reservation(); // Make the request - Operation response = reservationsClient.Insert(project, zone, reservationResource); + lro::Operation response = reservationsClient.Insert(project, zone, reservationResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = reservationsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -493,7 +606,23 @@ public async Task InsertAsync() string zone = ""; Reservation reservationResource = new Reservation(); // Make the request - Operation response = await reservationsClient.InsertAsync(project, zone, reservationResource); + lro::Operation response = await reservationsClient.InsertAsync(project, zone, reservationResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await reservationsClient.PollOnceInsertAsync(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 } @@ -709,7 +838,23 @@ public void ResizeRequestObject() ReservationsResizeRequestResource = new ReservationsResizeRequest(), }; // Make the request - Operation response = reservationsClient.Resize(request); + lro::Operation response = reservationsClient.Resize(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = reservationsClient.PollOnceResize(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 } @@ -730,7 +875,23 @@ public async Task ResizeRequestObjectAsync() ReservationsResizeRequestResource = new ReservationsResizeRequest(), }; // Make the request - Operation response = await reservationsClient.ResizeAsync(request); + lro::Operation response = await reservationsClient.ResizeAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await reservationsClient.PollOnceResizeAsync(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 } @@ -746,7 +907,23 @@ public void Resize() string reservation = ""; ReservationsResizeRequest reservationsResizeRequestResource = new ReservationsResizeRequest(); // Make the request - Operation response = reservationsClient.Resize(project, zone, reservation, reservationsResizeRequestResource); + lro::Operation response = reservationsClient.Resize(project, zone, reservation, reservationsResizeRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = reservationsClient.PollOnceResize(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 } @@ -763,7 +940,23 @@ public async Task ResizeAsync() string reservation = ""; ReservationsResizeRequest reservationsResizeRequestResource = new ReservationsResizeRequest(); // Make the request - Operation response = await reservationsClient.ResizeAsync(project, zone, reservation, reservationsResizeRequestResource); + lro::Operation response = await reservationsClient.ResizeAsync(project, zone, reservation, reservationsResizeRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await reservationsClient.PollOnceResizeAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ResourcePoliciesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ResourcePoliciesClientSnippets.g.cs index f224db931a4a..166753fe2018 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ResourcePoliciesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/ResourcePoliciesClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedResourcePoliciesClientSnippets @@ -234,7 +235,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = resourcePoliciesClient.Delete(request); + lro::Operation response = resourcePoliciesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = resourcePoliciesClient.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 } @@ -254,7 +271,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await resourcePoliciesClient.DeleteAsync(request); + lro::Operation response = await resourcePoliciesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await resourcePoliciesClient.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 } @@ -269,7 +302,23 @@ public void Delete() string region = ""; string resourcePolicy = ""; // Make the request - Operation response = resourcePoliciesClient.Delete(project, region, resourcePolicy); + lro::Operation response = resourcePoliciesClient.Delete(project, region, resourcePolicy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = resourcePoliciesClient.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 } @@ -285,7 +334,23 @@ public async Task DeleteAsync() string region = ""; string resourcePolicy = ""; // Make the request - Operation response = await resourcePoliciesClient.DeleteAsync(project, region, resourcePolicy); + lro::Operation response = await resourcePoliciesClient.DeleteAsync(project, region, resourcePolicy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await resourcePoliciesClient.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 } @@ -442,7 +507,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = resourcePoliciesClient.Insert(request); + lro::Operation response = resourcePoliciesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = resourcePoliciesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -462,7 +543,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await resourcePoliciesClient.InsertAsync(request); + lro::Operation response = await resourcePoliciesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await resourcePoliciesClient.PollOnceInsertAsync(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 } @@ -477,7 +574,23 @@ public void Insert() string region = ""; ResourcePolicy resourcePolicyResource = new ResourcePolicy(); // Make the request - Operation response = resourcePoliciesClient.Insert(project, region, resourcePolicyResource); + lro::Operation response = resourcePoliciesClient.Insert(project, region, resourcePolicyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = resourcePoliciesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -493,7 +606,23 @@ public async Task InsertAsync() string region = ""; ResourcePolicy resourcePolicyResource = new ResourcePolicy(); // Make the request - Operation response = await resourcePoliciesClient.InsertAsync(project, region, resourcePolicyResource); + lro::Operation response = await resourcePoliciesClient.InsertAsync(project, region, resourcePolicyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await resourcePoliciesClient.PollOnceInsertAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RoutersClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RoutersClientSnippets.g.cs index 8864b9e9bbd7..8cf6f2e9ac6a 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RoutersClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RoutersClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedRoutersClientSnippets @@ -234,7 +235,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = routersClient.Delete(request); + lro::Operation response = routersClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = routersClient.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 } @@ -254,7 +271,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await routersClient.DeleteAsync(request); + lro::Operation response = await routersClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await routersClient.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 } @@ -269,7 +302,23 @@ public void Delete() string region = ""; string router = ""; // Make the request - Operation response = routersClient.Delete(project, region, router); + lro::Operation response = routersClient.Delete(project, region, router); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = routersClient.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 } @@ -285,7 +334,23 @@ public async Task DeleteAsync() string region = ""; string router = ""; // Make the request - Operation response = await routersClient.DeleteAsync(project, region, router); + lro::Operation response = await routersClient.DeleteAsync(project, region, router); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await routersClient.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 } @@ -640,7 +705,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = routersClient.Insert(request); + lro::Operation response = routersClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = routersClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -660,7 +741,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await routersClient.InsertAsync(request); + lro::Operation response = await routersClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await routersClient.PollOnceInsertAsync(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 } @@ -675,7 +772,23 @@ public void Insert() string region = ""; Router routerResource = new Router(); // Make the request - Operation response = routersClient.Insert(project, region, routerResource); + lro::Operation response = routersClient.Insert(project, region, routerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = routersClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -691,7 +804,23 @@ public async Task InsertAsync() string region = ""; Router routerResource = new Router(); // Make the request - Operation response = await routersClient.InsertAsync(project, region, routerResource); + lro::Operation response = await routersClient.InsertAsync(project, region, routerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await routersClient.PollOnceInsertAsync(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 } @@ -907,7 +1036,23 @@ public void PatchRequestObject() Project = "", }; // Make the request - Operation response = routersClient.Patch(request); + lro::Operation response = routersClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = routersClient.PollOncePatch(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 } @@ -928,7 +1073,23 @@ public async Task PatchRequestObjectAsync() Project = "", }; // Make the request - Operation response = await routersClient.PatchAsync(request); + lro::Operation response = await routersClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await routersClient.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 } @@ -944,7 +1105,23 @@ public void Patch() string router = ""; Router routerResource = new Router(); // Make the request - Operation response = routersClient.Patch(project, region, router, routerResource); + lro::Operation response = routersClient.Patch(project, region, router, routerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = routersClient.PollOncePatch(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 } @@ -961,7 +1138,23 @@ public async Task PatchAsync() string router = ""; Router routerResource = new Router(); // Make the request - Operation response = await routersClient.PatchAsync(project, region, router, routerResource); + lro::Operation response = await routersClient.PatchAsync(project, region, router, routerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await routersClient.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 } @@ -1053,7 +1246,23 @@ public void UpdateRequestObject() Project = "", }; // Make the request - Operation response = routersClient.Update(request); + lro::Operation response = routersClient.Update(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = routersClient.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 } @@ -1074,7 +1283,23 @@ public async Task UpdateRequestObjectAsync() Project = "", }; // Make the request - Operation response = await routersClient.UpdateAsync(request); + lro::Operation response = await routersClient.UpdateAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await routersClient.PollOnceUpdateAsync(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 } @@ -1090,7 +1315,23 @@ public void Update() string router = ""; Router routerResource = new Router(); // Make the request - Operation response = routersClient.Update(project, region, router, routerResource); + lro::Operation response = routersClient.Update(project, region, router, routerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = routersClient.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 } @@ -1107,7 +1348,23 @@ public async Task UpdateAsync() string router = ""; Router routerResource = new Router(); // Make the request - Operation response = await routersClient.UpdateAsync(project, region, router, routerResource); + lro::Operation response = await routersClient.UpdateAsync(project, region, router, routerResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await routersClient.PollOnceUpdateAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RoutesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RoutesClientSnippets.g.cs index 017c4a3f5523..c457c87fee2a 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RoutesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/RoutesClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedRoutesClientSnippets @@ -38,7 +39,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = routesClient.Delete(request); + lro::Operation response = routesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = routesClient.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 } @@ -57,7 +74,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await routesClient.DeleteAsync(request); + lro::Operation response = await routesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await routesClient.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 } @@ -71,7 +104,23 @@ public void Delete() string project = ""; string route = ""; // Make the request - Operation response = routesClient.Delete(project, route); + lro::Operation response = routesClient.Delete(project, route); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = routesClient.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 } @@ -86,7 +135,23 @@ public async Task DeleteAsync() string project = ""; string route = ""; // Make the request - Operation response = await routesClient.DeleteAsync(project, route); + lro::Operation response = await routesClient.DeleteAsync(project, route); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await routesClient.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 } @@ -168,7 +233,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = routesClient.Insert(request); + lro::Operation response = routesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = routesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -187,7 +268,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await routesClient.InsertAsync(request); + lro::Operation response = await routesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await routesClient.PollOnceInsertAsync(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 } @@ -201,7 +298,23 @@ public void Insert() string project = ""; Route routeResource = new Route(); // Make the request - Operation response = routesClient.Insert(project, routeResource); + lro::Operation response = routesClient.Insert(project, routeResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = routesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -216,7 +329,23 @@ public async Task InsertAsync() string project = ""; Route routeResource = new Route(); // Make the request - Operation response = await routesClient.InsertAsync(project, routeResource); + lro::Operation response = await routesClient.InsertAsync(project, routeResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await routesClient.PollOnceInsertAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/SecurityPoliciesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/SecurityPoliciesClientSnippets.g.cs index c0fb7a9a5d8b..82de042eb392 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/SecurityPoliciesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/SecurityPoliciesClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedSecurityPoliciesClientSnippets @@ -38,7 +39,23 @@ public void AddRuleRequestObject() SecurityPolicyRuleResource = new SecurityPolicyRule(), }; // Make the request - Operation response = securityPoliciesClient.AddRule(request); + lro::Operation response = securityPoliciesClient.AddRule(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = securityPoliciesClient.PollOnceAddRule(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 } @@ -57,7 +74,23 @@ public async Task AddRuleRequestObjectAsync() SecurityPolicyRuleResource = new SecurityPolicyRule(), }; // Make the request - Operation response = await securityPoliciesClient.AddRuleAsync(request); + lro::Operation response = await securityPoliciesClient.AddRuleAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await securityPoliciesClient.PollOnceAddRuleAsync(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 } @@ -72,7 +105,23 @@ public void AddRule() string securityPolicy = ""; SecurityPolicyRule securityPolicyRuleResource = new SecurityPolicyRule(); // Make the request - Operation response = securityPoliciesClient.AddRule(project, securityPolicy, securityPolicyRuleResource); + lro::Operation response = securityPoliciesClient.AddRule(project, securityPolicy, securityPolicyRuleResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = securityPoliciesClient.PollOnceAddRule(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 } @@ -88,7 +137,23 @@ public async Task AddRuleAsync() string securityPolicy = ""; SecurityPolicyRule securityPolicyRuleResource = new SecurityPolicyRule(); // Make the request - Operation response = await securityPoliciesClient.AddRuleAsync(project, securityPolicy, securityPolicyRuleResource); + lro::Operation response = await securityPoliciesClient.AddRuleAsync(project, securityPolicy, securityPolicyRuleResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await securityPoliciesClient.PollOnceAddRuleAsync(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 } @@ -106,7 +171,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = securityPoliciesClient.Delete(request); + lro::Operation response = securityPoliciesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = securityPoliciesClient.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 } @@ -125,7 +206,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await securityPoliciesClient.DeleteAsync(request); + lro::Operation response = await securityPoliciesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await securityPoliciesClient.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 } @@ -139,7 +236,23 @@ public void Delete() string project = ""; string securityPolicy = ""; // Make the request - Operation response = securityPoliciesClient.Delete(project, securityPolicy); + lro::Operation response = securityPoliciesClient.Delete(project, securityPolicy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = securityPoliciesClient.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 } @@ -154,7 +267,23 @@ public async Task DeleteAsync() string project = ""; string securityPolicy = ""; // Make the request - Operation response = await securityPoliciesClient.DeleteAsync(project, securityPolicy); + lro::Operation response = await securityPoliciesClient.DeleteAsync(project, securityPolicy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await securityPoliciesClient.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 } @@ -302,7 +431,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = securityPoliciesClient.Insert(request); + lro::Operation response = securityPoliciesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = securityPoliciesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -321,7 +466,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await securityPoliciesClient.InsertAsync(request); + lro::Operation response = await securityPoliciesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await securityPoliciesClient.PollOnceInsertAsync(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 } @@ -335,7 +496,23 @@ public void Insert() string project = ""; SecurityPolicy securityPolicyResource = new SecurityPolicy(); // Make the request - Operation response = securityPoliciesClient.Insert(project, securityPolicyResource); + lro::Operation response = securityPoliciesClient.Insert(project, securityPolicyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = securityPoliciesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -350,7 +527,23 @@ public async Task InsertAsync() string project = ""; SecurityPolicy securityPolicyResource = new SecurityPolicy(); // Make the request - Operation response = await securityPoliciesClient.InsertAsync(project, securityPolicyResource); + lro::Operation response = await securityPoliciesClient.InsertAsync(project, securityPolicyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await securityPoliciesClient.PollOnceInsertAsync(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 } @@ -631,7 +824,23 @@ public void PatchRequestObject() Project = "", }; // Make the request - Operation response = securityPoliciesClient.Patch(request); + lro::Operation response = securityPoliciesClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = securityPoliciesClient.PollOncePatch(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 } @@ -651,7 +860,23 @@ public async Task PatchRequestObjectAsync() Project = "", }; // Make the request - Operation response = await securityPoliciesClient.PatchAsync(request); + lro::Operation response = await securityPoliciesClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await securityPoliciesClient.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 } @@ -666,7 +891,23 @@ public void Patch() string securityPolicy = ""; SecurityPolicy securityPolicyResource = new SecurityPolicy(); // Make the request - Operation response = securityPoliciesClient.Patch(project, securityPolicy, securityPolicyResource); + lro::Operation response = securityPoliciesClient.Patch(project, securityPolicy, securityPolicyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = securityPoliciesClient.PollOncePatch(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 } @@ -682,7 +923,23 @@ public async Task PatchAsync() string securityPolicy = ""; SecurityPolicy securityPolicyResource = new SecurityPolicy(); // Make the request - Operation response = await securityPoliciesClient.PatchAsync(project, securityPolicy, securityPolicyResource); + lro::Operation response = await securityPoliciesClient.PatchAsync(project, securityPolicy, securityPolicyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await securityPoliciesClient.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 } @@ -701,7 +958,23 @@ public void PatchRuleRequestObject() Priority = 0, }; // Make the request - Operation response = securityPoliciesClient.PatchRule(request); + lro::Operation response = securityPoliciesClient.PatchRule(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = securityPoliciesClient.PollOncePatchRule(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 } @@ -721,7 +994,23 @@ public async Task PatchRuleRequestObjectAsync() Priority = 0, }; // Make the request - Operation response = await securityPoliciesClient.PatchRuleAsync(request); + lro::Operation response = await securityPoliciesClient.PatchRuleAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await securityPoliciesClient.PollOncePatchRuleAsync(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 } @@ -736,7 +1025,23 @@ public void PatchRule() string securityPolicy = ""; SecurityPolicyRule securityPolicyRuleResource = new SecurityPolicyRule(); // Make the request - Operation response = securityPoliciesClient.PatchRule(project, securityPolicy, securityPolicyRuleResource); + lro::Operation response = securityPoliciesClient.PatchRule(project, securityPolicy, securityPolicyRuleResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = securityPoliciesClient.PollOncePatchRule(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 } @@ -752,7 +1057,23 @@ public async Task PatchRuleAsync() string securityPolicy = ""; SecurityPolicyRule securityPolicyRuleResource = new SecurityPolicyRule(); // Make the request - Operation response = await securityPoliciesClient.PatchRuleAsync(project, securityPolicy, securityPolicyRuleResource); + lro::Operation response = await securityPoliciesClient.PatchRuleAsync(project, securityPolicy, securityPolicyRuleResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await securityPoliciesClient.PollOncePatchRuleAsync(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 } @@ -770,7 +1091,23 @@ public void RemoveRuleRequestObject() Priority = 0, }; // Make the request - Operation response = securityPoliciesClient.RemoveRule(request); + lro::Operation response = securityPoliciesClient.RemoveRule(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = securityPoliciesClient.PollOnceRemoveRule(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 } @@ -789,7 +1126,23 @@ public async Task RemoveRuleRequestObjectAsync() Priority = 0, }; // Make the request - Operation response = await securityPoliciesClient.RemoveRuleAsync(request); + lro::Operation response = await securityPoliciesClient.RemoveRuleAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await securityPoliciesClient.PollOnceRemoveRuleAsync(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 } @@ -803,7 +1156,23 @@ public void RemoveRule() string project = ""; string securityPolicy = ""; // Make the request - Operation response = securityPoliciesClient.RemoveRule(project, securityPolicy); + lro::Operation response = securityPoliciesClient.RemoveRule(project, securityPolicy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = securityPoliciesClient.PollOnceRemoveRule(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 } @@ -818,7 +1187,23 @@ public async Task RemoveRuleAsync() string project = ""; string securityPolicy = ""; // Make the request - Operation response = await securityPoliciesClient.RemoveRuleAsync(project, securityPolicy); + lro::Operation response = await securityPoliciesClient.RemoveRuleAsync(project, securityPolicy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await securityPoliciesClient.PollOnceRemoveRuleAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/SnapshotsClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/SnapshotsClientSnippets.g.cs index d1a10bde1e53..8ecb11bdd4e7 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/SnapshotsClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/SnapshotsClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedSnapshotsClientSnippets @@ -38,7 +39,23 @@ public void DeleteRequestObject() Snapshot = "", }; // Make the request - Operation response = snapshotsClient.Delete(request); + lro::Operation response = snapshotsClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = snapshotsClient.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 } @@ -57,7 +74,23 @@ public async Task DeleteRequestObjectAsync() Snapshot = "", }; // Make the request - Operation response = await snapshotsClient.DeleteAsync(request); + lro::Operation response = await snapshotsClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await snapshotsClient.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 } @@ -71,7 +104,23 @@ public void Delete() string project = ""; string snapshot = ""; // Make the request - Operation response = snapshotsClient.Delete(project, snapshot); + lro::Operation response = snapshotsClient.Delete(project, snapshot); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = snapshotsClient.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 } @@ -86,7 +135,23 @@ public async Task DeleteAsync() string project = ""; string snapshot = ""; // Make the request - Operation response = await snapshotsClient.DeleteAsync(project, snapshot); + lro::Operation response = await snapshotsClient.DeleteAsync(project, snapshot); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await snapshotsClient.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 } @@ -494,7 +559,23 @@ public void SetLabelsRequestObject() GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), }; // Make the request - Operation response = snapshotsClient.SetLabels(request); + lro::Operation response = snapshotsClient.SetLabels(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = snapshotsClient.PollOnceSetLabels(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -513,7 +594,23 @@ public async Task SetLabelsRequestObjectAsync() GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), }; // Make the request - Operation response = await snapshotsClient.SetLabelsAsync(request); + lro::Operation response = await snapshotsClient.SetLabelsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await snapshotsClient.PollOnceSetLabelsAsync(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 } @@ -528,7 +625,23 @@ public void SetLabels() string resource = ""; GlobalSetLabelsRequest globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); // Make the request - Operation response = snapshotsClient.SetLabels(project, resource, globalSetLabelsRequestResource); + lro::Operation response = snapshotsClient.SetLabels(project, resource, globalSetLabelsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = snapshotsClient.PollOnceSetLabels(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -544,7 +657,23 @@ public async Task SetLabelsAsync() string resource = ""; GlobalSetLabelsRequest globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); // Make the request - Operation response = await snapshotsClient.SetLabelsAsync(project, resource, globalSetLabelsRequestResource); + lro::Operation response = await snapshotsClient.SetLabelsAsync(project, resource, globalSetLabelsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await snapshotsClient.PollOnceSetLabelsAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/SslCertificatesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/SslCertificatesClientSnippets.g.cs index ada630a66f3c..27f7d91b2c3a 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/SslCertificatesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/SslCertificatesClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedSslCertificatesClientSnippets @@ -233,7 +234,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = sslCertificatesClient.Delete(request); + lro::Operation response = sslCertificatesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = sslCertificatesClient.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 } @@ -252,7 +269,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await sslCertificatesClient.DeleteAsync(request); + lro::Operation response = await sslCertificatesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await sslCertificatesClient.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 } @@ -266,7 +299,23 @@ public void Delete() string project = ""; string sslCertificate = ""; // Make the request - Operation response = sslCertificatesClient.Delete(project, sslCertificate); + lro::Operation response = sslCertificatesClient.Delete(project, sslCertificate); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = sslCertificatesClient.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 } @@ -281,7 +330,23 @@ public async Task DeleteAsync() string project = ""; string sslCertificate = ""; // Make the request - Operation response = await sslCertificatesClient.DeleteAsync(project, sslCertificate); + lro::Operation response = await sslCertificatesClient.DeleteAsync(project, sslCertificate); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await sslCertificatesClient.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 } @@ -363,7 +428,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = sslCertificatesClient.Insert(request); + lro::Operation response = sslCertificatesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = sslCertificatesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -382,7 +463,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await sslCertificatesClient.InsertAsync(request); + lro::Operation response = await sslCertificatesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await sslCertificatesClient.PollOnceInsertAsync(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 } @@ -396,7 +493,23 @@ public void Insert() string project = ""; SslCertificate sslCertificateResource = new SslCertificate(); // Make the request - Operation response = sslCertificatesClient.Insert(project, sslCertificateResource); + lro::Operation response = sslCertificatesClient.Insert(project, sslCertificateResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = sslCertificatesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -411,7 +524,23 @@ public async Task InsertAsync() string project = ""; SslCertificate sslCertificateResource = new SslCertificate(); // Make the request - Operation response = await sslCertificatesClient.InsertAsync(project, sslCertificateResource); + lro::Operation response = await sslCertificatesClient.InsertAsync(project, sslCertificateResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await sslCertificatesClient.PollOnceInsertAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/SslPoliciesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/SslPoliciesClientSnippets.g.cs index 81cd5f32d6cf..9d2e51a9ec10 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/SslPoliciesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/SslPoliciesClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedSslPoliciesClientSnippets @@ -38,7 +39,23 @@ public void DeleteRequestObject() SslPolicy = "", }; // Make the request - Operation response = sslPoliciesClient.Delete(request); + lro::Operation response = sslPoliciesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = sslPoliciesClient.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 } @@ -57,7 +74,23 @@ public async Task DeleteRequestObjectAsync() SslPolicy = "", }; // Make the request - Operation response = await sslPoliciesClient.DeleteAsync(request); + lro::Operation response = await sslPoliciesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await sslPoliciesClient.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 } @@ -71,7 +104,23 @@ public void Delete() string project = ""; string sslPolicy = ""; // Make the request - Operation response = sslPoliciesClient.Delete(project, sslPolicy); + lro::Operation response = sslPoliciesClient.Delete(project, sslPolicy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = sslPoliciesClient.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 } @@ -86,7 +135,23 @@ public async Task DeleteAsync() string project = ""; string sslPolicy = ""; // Make the request - Operation response = await sslPoliciesClient.DeleteAsync(project, sslPolicy); + lro::Operation response = await sslPoliciesClient.DeleteAsync(project, sslPolicy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await sslPoliciesClient.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 } @@ -168,7 +233,23 @@ public void InsertRequestObject() SslPolicyResource = new SslPolicy(), }; // Make the request - Operation response = sslPoliciesClient.Insert(request); + lro::Operation response = sslPoliciesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = sslPoliciesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -187,7 +268,23 @@ public async Task InsertRequestObjectAsync() SslPolicyResource = new SslPolicy(), }; // Make the request - Operation response = await sslPoliciesClient.InsertAsync(request); + lro::Operation response = await sslPoliciesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await sslPoliciesClient.PollOnceInsertAsync(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 } @@ -201,7 +298,23 @@ public void Insert() string project = ""; SslPolicy sslPolicyResource = new SslPolicy(); // Make the request - Operation response = sslPoliciesClient.Insert(project, sslPolicyResource); + lro::Operation response = sslPoliciesClient.Insert(project, sslPolicyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = sslPoliciesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -216,7 +329,23 @@ public async Task InsertAsync() string project = ""; SslPolicy sslPolicyResource = new SslPolicy(); // Make the request - Operation response = await sslPoliciesClient.InsertAsync(project, sslPolicyResource); + lro::Operation response = await sslPoliciesClient.InsertAsync(project, sslPolicyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await sslPoliciesClient.PollOnceInsertAsync(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 } @@ -497,7 +626,23 @@ public void PatchRequestObject() SslPolicy = "", }; // Make the request - Operation response = sslPoliciesClient.Patch(request); + lro::Operation response = sslPoliciesClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = sslPoliciesClient.PollOncePatch(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 } @@ -517,7 +662,23 @@ public async Task PatchRequestObjectAsync() SslPolicy = "", }; // Make the request - Operation response = await sslPoliciesClient.PatchAsync(request); + lro::Operation response = await sslPoliciesClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await sslPoliciesClient.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 } @@ -532,7 +693,23 @@ public void Patch() string sslPolicy = ""; SslPolicy sslPolicyResource = new SslPolicy(); // Make the request - Operation response = sslPoliciesClient.Patch(project, sslPolicy, sslPolicyResource); + lro::Operation response = sslPoliciesClient.Patch(project, sslPolicy, sslPolicyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = sslPoliciesClient.PollOncePatch(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 } @@ -548,7 +725,23 @@ public async Task PatchAsync() string sslPolicy = ""; SslPolicy sslPolicyResource = new SslPolicy(); // Make the request - Operation response = await sslPoliciesClient.PatchAsync(project, sslPolicy, sslPolicyResource); + lro::Operation response = await sslPoliciesClient.PatchAsync(project, sslPolicy, sslPolicyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await sslPoliciesClient.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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/SubnetworksClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/SubnetworksClientSnippets.g.cs index 2dad747a6e50..5a2e68fe4c64 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/SubnetworksClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/SubnetworksClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedSubnetworksClientSnippets @@ -234,7 +235,23 @@ public void DeleteRequestObject() Subnetwork = "", }; // Make the request - Operation response = subnetworksClient.Delete(request); + lro::Operation response = subnetworksClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = subnetworksClient.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 } @@ -254,7 +271,23 @@ public async Task DeleteRequestObjectAsync() Subnetwork = "", }; // Make the request - Operation response = await subnetworksClient.DeleteAsync(request); + lro::Operation response = await subnetworksClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await subnetworksClient.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 } @@ -269,7 +302,23 @@ public void Delete() string region = ""; string subnetwork = ""; // Make the request - Operation response = subnetworksClient.Delete(project, region, subnetwork); + lro::Operation response = subnetworksClient.Delete(project, region, subnetwork); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = subnetworksClient.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 } @@ -285,7 +334,23 @@ public async Task DeleteAsync() string region = ""; string subnetwork = ""; // Make the request - Operation response = await subnetworksClient.DeleteAsync(project, region, subnetwork); + lro::Operation response = await subnetworksClient.DeleteAsync(project, region, subnetwork); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await subnetworksClient.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 } @@ -305,7 +370,23 @@ public void ExpandIpCidrRangeRequestObject() SubnetworksExpandIpCidrRangeRequestResource = new SubnetworksExpandIpCidrRangeRequest(), }; // Make the request - Operation response = subnetworksClient.ExpandIpCidrRange(request); + lro::Operation response = subnetworksClient.ExpandIpCidrRange(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = subnetworksClient.PollOnceExpandIpCidrRange(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 } @@ -326,7 +407,23 @@ public async Task ExpandIpCidrRangeRequestObjectAsync() SubnetworksExpandIpCidrRangeRequestResource = new SubnetworksExpandIpCidrRangeRequest(), }; // Make the request - Operation response = await subnetworksClient.ExpandIpCidrRangeAsync(request); + lro::Operation response = await subnetworksClient.ExpandIpCidrRangeAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await subnetworksClient.PollOnceExpandIpCidrRangeAsync(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 } @@ -342,7 +439,23 @@ public void ExpandIpCidrRange() string subnetwork = ""; SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = new SubnetworksExpandIpCidrRangeRequest(); // Make the request - Operation response = subnetworksClient.ExpandIpCidrRange(project, region, subnetwork, subnetworksExpandIpCidrRangeRequestResource); + lro::Operation response = subnetworksClient.ExpandIpCidrRange(project, region, subnetwork, subnetworksExpandIpCidrRangeRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = subnetworksClient.PollOnceExpandIpCidrRange(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 } @@ -359,7 +472,23 @@ public async Task ExpandIpCidrRangeAsync() string subnetwork = ""; SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource = new SubnetworksExpandIpCidrRangeRequest(); // Make the request - Operation response = await subnetworksClient.ExpandIpCidrRangeAsync(project, region, subnetwork, subnetworksExpandIpCidrRangeRequestResource); + lro::Operation response = await subnetworksClient.ExpandIpCidrRangeAsync(project, region, subnetwork, subnetworksExpandIpCidrRangeRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await subnetworksClient.PollOnceExpandIpCidrRangeAsync(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 } @@ -516,7 +645,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = subnetworksClient.Insert(request); + lro::Operation response = subnetworksClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = subnetworksClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -536,7 +681,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await subnetworksClient.InsertAsync(request); + lro::Operation response = await subnetworksClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await subnetworksClient.PollOnceInsertAsync(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 } @@ -551,7 +712,23 @@ public void Insert() string region = ""; Subnetwork subnetworkResource = new Subnetwork(); // Make the request - Operation response = subnetworksClient.Insert(project, region, subnetworkResource); + lro::Operation response = subnetworksClient.Insert(project, region, subnetworkResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = subnetworksClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -567,7 +744,23 @@ public async Task InsertAsync() string region = ""; Subnetwork subnetworkResource = new Subnetwork(); // Make the request - Operation response = await subnetworksClient.InsertAsync(project, region, subnetworkResource); + lro::Operation response = await subnetworksClient.InsertAsync(project, region, subnetworkResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await subnetworksClient.PollOnceInsertAsync(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 } @@ -976,7 +1169,23 @@ public void PatchRequestObject() DrainTimeoutSeconds = 0, }; // Make the request - Operation response = subnetworksClient.Patch(request); + lro::Operation response = subnetworksClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = subnetworksClient.PollOncePatch(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 } @@ -998,7 +1207,23 @@ public async Task PatchRequestObjectAsync() DrainTimeoutSeconds = 0, }; // Make the request - Operation response = await subnetworksClient.PatchAsync(request); + lro::Operation response = await subnetworksClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await subnetworksClient.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 } @@ -1014,7 +1239,23 @@ public void Patch() string subnetwork = ""; Subnetwork subnetworkResource = new Subnetwork(); // Make the request - Operation response = subnetworksClient.Patch(project, region, subnetwork, subnetworkResource); + lro::Operation response = subnetworksClient.Patch(project, region, subnetwork, subnetworkResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = subnetworksClient.PollOncePatch(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 } @@ -1031,7 +1272,23 @@ public async Task PatchAsync() string subnetwork = ""; Subnetwork subnetworkResource = new Subnetwork(); // Make the request - Operation response = await subnetworksClient.PatchAsync(project, region, subnetwork, subnetworkResource); + lro::Operation response = await subnetworksClient.PatchAsync(project, region, subnetwork, subnetworkResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await subnetworksClient.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 } @@ -1123,7 +1380,23 @@ public void SetPrivateIpGoogleAccessRequestObject() Subnetwork = "", }; // Make the request - Operation response = subnetworksClient.SetPrivateIpGoogleAccess(request); + lro::Operation response = subnetworksClient.SetPrivateIpGoogleAccess(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = subnetworksClient.PollOnceSetPrivateIpGoogleAccess(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 } @@ -1144,7 +1417,23 @@ public async Task SetPrivateIpGoogleAccessRequestObjectAsync() Subnetwork = "", }; // Make the request - Operation response = await subnetworksClient.SetPrivateIpGoogleAccessAsync(request); + lro::Operation response = await subnetworksClient.SetPrivateIpGoogleAccessAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await subnetworksClient.PollOnceSetPrivateIpGoogleAccessAsync(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 } @@ -1160,7 +1449,23 @@ public void SetPrivateIpGoogleAccess() string subnetwork = ""; SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource = new SubnetworksSetPrivateIpGoogleAccessRequest(); // Make the request - Operation response = subnetworksClient.SetPrivateIpGoogleAccess(project, region, subnetwork, subnetworksSetPrivateIpGoogleAccessRequestResource); + lro::Operation response = subnetworksClient.SetPrivateIpGoogleAccess(project, region, subnetwork, subnetworksSetPrivateIpGoogleAccessRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = subnetworksClient.PollOnceSetPrivateIpGoogleAccess(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 } @@ -1177,7 +1482,23 @@ public async Task SetPrivateIpGoogleAccessAsync() string subnetwork = ""; SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource = new SubnetworksSetPrivateIpGoogleAccessRequest(); // Make the request - Operation response = await subnetworksClient.SetPrivateIpGoogleAccessAsync(project, region, subnetwork, subnetworksSetPrivateIpGoogleAccessRequestResource); + lro::Operation response = await subnetworksClient.SetPrivateIpGoogleAccessAsync(project, region, subnetwork, subnetworksSetPrivateIpGoogleAccessRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await subnetworksClient.PollOnceSetPrivateIpGoogleAccessAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetGrpcProxiesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetGrpcProxiesClientSnippets.g.cs index 4f7bf2e8f275..d0cb40833697 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetGrpcProxiesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetGrpcProxiesClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedTargetGrpcProxiesClientSnippets @@ -38,7 +39,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = targetGrpcProxiesClient.Delete(request); + lro::Operation response = targetGrpcProxiesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetGrpcProxiesClient.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 } @@ -57,7 +74,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await targetGrpcProxiesClient.DeleteAsync(request); + lro::Operation response = await targetGrpcProxiesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetGrpcProxiesClient.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 } @@ -71,7 +104,23 @@ public void Delete() string project = ""; string targetGrpcProxy = ""; // Make the request - Operation response = targetGrpcProxiesClient.Delete(project, targetGrpcProxy); + lro::Operation response = targetGrpcProxiesClient.Delete(project, targetGrpcProxy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetGrpcProxiesClient.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 } @@ -86,7 +135,23 @@ public async Task DeleteAsync() string project = ""; string targetGrpcProxy = ""; // Make the request - Operation response = await targetGrpcProxiesClient.DeleteAsync(project, targetGrpcProxy); + lro::Operation response = await targetGrpcProxiesClient.DeleteAsync(project, targetGrpcProxy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetGrpcProxiesClient.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 } @@ -168,7 +233,23 @@ public void InsertRequestObject() TargetGrpcProxyResource = new TargetGrpcProxy(), }; // Make the request - Operation response = targetGrpcProxiesClient.Insert(request); + lro::Operation response = targetGrpcProxiesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetGrpcProxiesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -187,7 +268,23 @@ public async Task InsertRequestObjectAsync() TargetGrpcProxyResource = new TargetGrpcProxy(), }; // Make the request - Operation response = await targetGrpcProxiesClient.InsertAsync(request); + lro::Operation response = await targetGrpcProxiesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetGrpcProxiesClient.PollOnceInsertAsync(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 } @@ -201,7 +298,23 @@ public void Insert() string project = ""; TargetGrpcProxy targetGrpcProxyResource = new TargetGrpcProxy(); // Make the request - Operation response = targetGrpcProxiesClient.Insert(project, targetGrpcProxyResource); + lro::Operation response = targetGrpcProxiesClient.Insert(project, targetGrpcProxyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetGrpcProxiesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -216,7 +329,23 @@ public async Task InsertAsync() string project = ""; TargetGrpcProxy targetGrpcProxyResource = new TargetGrpcProxy(); // Make the request - Operation response = await targetGrpcProxiesClient.InsertAsync(project, targetGrpcProxyResource); + lro::Operation response = await targetGrpcProxiesClient.InsertAsync(project, targetGrpcProxyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetGrpcProxiesClient.PollOnceInsertAsync(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 } @@ -427,7 +556,23 @@ public void PatchRequestObject() TargetGrpcProxyResource = new TargetGrpcProxy(), }; // Make the request - Operation response = targetGrpcProxiesClient.Patch(request); + lro::Operation response = targetGrpcProxiesClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetGrpcProxiesClient.PollOncePatch(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 } @@ -447,7 +592,23 @@ public async Task PatchRequestObjectAsync() TargetGrpcProxyResource = new TargetGrpcProxy(), }; // Make the request - Operation response = await targetGrpcProxiesClient.PatchAsync(request); + lro::Operation response = await targetGrpcProxiesClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetGrpcProxiesClient.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 } @@ -462,7 +623,23 @@ public void Patch() string targetGrpcProxy = ""; TargetGrpcProxy targetGrpcProxyResource = new TargetGrpcProxy(); // Make the request - Operation response = targetGrpcProxiesClient.Patch(project, targetGrpcProxy, targetGrpcProxyResource); + lro::Operation response = targetGrpcProxiesClient.Patch(project, targetGrpcProxy, targetGrpcProxyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetGrpcProxiesClient.PollOncePatch(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 } @@ -478,7 +655,23 @@ public async Task PatchAsync() string targetGrpcProxy = ""; TargetGrpcProxy targetGrpcProxyResource = new TargetGrpcProxy(); // Make the request - Operation response = await targetGrpcProxiesClient.PatchAsync(project, targetGrpcProxy, targetGrpcProxyResource); + lro::Operation response = await targetGrpcProxiesClient.PatchAsync(project, targetGrpcProxy, targetGrpcProxyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetGrpcProxiesClient.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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetHttpProxiesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetHttpProxiesClientSnippets.g.cs index 8db86b21b439..5bcd57730147 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetHttpProxiesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetHttpProxiesClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedTargetHttpProxiesClientSnippets @@ -233,7 +234,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = targetHttpProxiesClient.Delete(request); + lro::Operation response = targetHttpProxiesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetHttpProxiesClient.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 } @@ -252,7 +269,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await targetHttpProxiesClient.DeleteAsync(request); + lro::Operation response = await targetHttpProxiesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetHttpProxiesClient.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 } @@ -266,7 +299,23 @@ public void Delete() string project = ""; string targetHttpProxy = ""; // Make the request - Operation response = targetHttpProxiesClient.Delete(project, targetHttpProxy); + lro::Operation response = targetHttpProxiesClient.Delete(project, targetHttpProxy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetHttpProxiesClient.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 } @@ -281,7 +330,23 @@ public async Task DeleteAsync() string project = ""; string targetHttpProxy = ""; // Make the request - Operation response = await targetHttpProxiesClient.DeleteAsync(project, targetHttpProxy); + lro::Operation response = await targetHttpProxiesClient.DeleteAsync(project, targetHttpProxy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetHttpProxiesClient.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 } @@ -363,7 +428,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = targetHttpProxiesClient.Insert(request); + lro::Operation response = targetHttpProxiesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetHttpProxiesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -382,7 +463,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await targetHttpProxiesClient.InsertAsync(request); + lro::Operation response = await targetHttpProxiesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetHttpProxiesClient.PollOnceInsertAsync(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 } @@ -396,7 +493,23 @@ public void Insert() string project = ""; TargetHttpProxy targetHttpProxyResource = new TargetHttpProxy(); // Make the request - Operation response = targetHttpProxiesClient.Insert(project, targetHttpProxyResource); + lro::Operation response = targetHttpProxiesClient.Insert(project, targetHttpProxyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetHttpProxiesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -411,7 +524,23 @@ public async Task InsertAsync() string project = ""; TargetHttpProxy targetHttpProxyResource = new TargetHttpProxy(); // Make the request - Operation response = await targetHttpProxiesClient.InsertAsync(project, targetHttpProxyResource); + lro::Operation response = await targetHttpProxiesClient.InsertAsync(project, targetHttpProxyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetHttpProxiesClient.PollOnceInsertAsync(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 } @@ -622,7 +751,23 @@ public void PatchRequestObject() Project = "", }; // Make the request - Operation response = targetHttpProxiesClient.Patch(request); + lro::Operation response = targetHttpProxiesClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetHttpProxiesClient.PollOncePatch(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 } @@ -642,7 +787,23 @@ public async Task PatchRequestObjectAsync() Project = "", }; // Make the request - Operation response = await targetHttpProxiesClient.PatchAsync(request); + lro::Operation response = await targetHttpProxiesClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetHttpProxiesClient.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 } @@ -657,7 +818,23 @@ public void Patch() string targetHttpProxy = ""; TargetHttpProxy targetHttpProxyResource = new TargetHttpProxy(); // Make the request - Operation response = targetHttpProxiesClient.Patch(project, targetHttpProxy, targetHttpProxyResource); + lro::Operation response = targetHttpProxiesClient.Patch(project, targetHttpProxy, targetHttpProxyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetHttpProxiesClient.PollOncePatch(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 } @@ -673,7 +850,23 @@ public async Task PatchAsync() string targetHttpProxy = ""; TargetHttpProxy targetHttpProxyResource = new TargetHttpProxy(); // Make the request - Operation response = await targetHttpProxiesClient.PatchAsync(project, targetHttpProxy, targetHttpProxyResource); + lro::Operation response = await targetHttpProxiesClient.PatchAsync(project, targetHttpProxy, targetHttpProxyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetHttpProxiesClient.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 } @@ -692,7 +885,23 @@ public void SetUrlMapRequestObject() UrlMapReferenceResource = new UrlMapReference(), }; // Make the request - Operation response = targetHttpProxiesClient.SetUrlMap(request); + lro::Operation response = targetHttpProxiesClient.SetUrlMap(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetHttpProxiesClient.PollOnceSetUrlMap(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 } @@ -712,7 +921,23 @@ public async Task SetUrlMapRequestObjectAsync() UrlMapReferenceResource = new UrlMapReference(), }; // Make the request - Operation response = await targetHttpProxiesClient.SetUrlMapAsync(request); + lro::Operation response = await targetHttpProxiesClient.SetUrlMapAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetHttpProxiesClient.PollOnceSetUrlMapAsync(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 } @@ -727,7 +952,23 @@ public void SetUrlMap() string targetHttpProxy = ""; UrlMapReference urlMapReferenceResource = new UrlMapReference(); // Make the request - Operation response = targetHttpProxiesClient.SetUrlMap(project, targetHttpProxy, urlMapReferenceResource); + lro::Operation response = targetHttpProxiesClient.SetUrlMap(project, targetHttpProxy, urlMapReferenceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetHttpProxiesClient.PollOnceSetUrlMap(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 } @@ -743,7 +984,23 @@ public async Task SetUrlMapAsync() string targetHttpProxy = ""; UrlMapReference urlMapReferenceResource = new UrlMapReference(); // Make the request - Operation response = await targetHttpProxiesClient.SetUrlMapAsync(project, targetHttpProxy, urlMapReferenceResource); + lro::Operation response = await targetHttpProxiesClient.SetUrlMapAsync(project, targetHttpProxy, urlMapReferenceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetHttpProxiesClient.PollOnceSetUrlMapAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetHttpsProxiesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetHttpsProxiesClientSnippets.g.cs index 56aefe29dd2a..c7a5b9d5b880 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetHttpsProxiesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetHttpsProxiesClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedTargetHttpsProxiesClientSnippets @@ -233,7 +234,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = targetHttpsProxiesClient.Delete(request); + lro::Operation response = targetHttpsProxiesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetHttpsProxiesClient.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 } @@ -252,7 +269,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await targetHttpsProxiesClient.DeleteAsync(request); + lro::Operation response = await targetHttpsProxiesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetHttpsProxiesClient.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 } @@ -266,7 +299,23 @@ public void Delete() string project = ""; string targetHttpsProxy = ""; // Make the request - Operation response = targetHttpsProxiesClient.Delete(project, targetHttpsProxy); + lro::Operation response = targetHttpsProxiesClient.Delete(project, targetHttpsProxy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetHttpsProxiesClient.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 } @@ -281,7 +330,23 @@ public async Task DeleteAsync() string project = ""; string targetHttpsProxy = ""; // Make the request - Operation response = await targetHttpsProxiesClient.DeleteAsync(project, targetHttpsProxy); + lro::Operation response = await targetHttpsProxiesClient.DeleteAsync(project, targetHttpsProxy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetHttpsProxiesClient.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 } @@ -363,7 +428,23 @@ public void InsertRequestObject() TargetHttpsProxyResource = new TargetHttpsProxy(), }; // Make the request - Operation response = targetHttpsProxiesClient.Insert(request); + lro::Operation response = targetHttpsProxiesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetHttpsProxiesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -382,7 +463,23 @@ public async Task InsertRequestObjectAsync() TargetHttpsProxyResource = new TargetHttpsProxy(), }; // Make the request - Operation response = await targetHttpsProxiesClient.InsertAsync(request); + lro::Operation response = await targetHttpsProxiesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetHttpsProxiesClient.PollOnceInsertAsync(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 } @@ -396,7 +493,23 @@ public void Insert() string project = ""; TargetHttpsProxy targetHttpsProxyResource = new TargetHttpsProxy(); // Make the request - Operation response = targetHttpsProxiesClient.Insert(project, targetHttpsProxyResource); + lro::Operation response = targetHttpsProxiesClient.Insert(project, targetHttpsProxyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetHttpsProxiesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -411,7 +524,23 @@ public async Task InsertAsync() string project = ""; TargetHttpsProxy targetHttpsProxyResource = new TargetHttpsProxy(); // Make the request - Operation response = await targetHttpsProxiesClient.InsertAsync(project, targetHttpsProxyResource); + lro::Operation response = await targetHttpsProxiesClient.InsertAsync(project, targetHttpsProxyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetHttpsProxiesClient.PollOnceInsertAsync(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 } @@ -622,7 +751,23 @@ public void PatchRequestObject() TargetHttpsProxyResource = new TargetHttpsProxy(), }; // Make the request - Operation response = targetHttpsProxiesClient.Patch(request); + lro::Operation response = targetHttpsProxiesClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetHttpsProxiesClient.PollOncePatch(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 } @@ -642,7 +787,23 @@ public async Task PatchRequestObjectAsync() TargetHttpsProxyResource = new TargetHttpsProxy(), }; // Make the request - Operation response = await targetHttpsProxiesClient.PatchAsync(request); + lro::Operation response = await targetHttpsProxiesClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetHttpsProxiesClient.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 } @@ -657,7 +818,23 @@ public void Patch() string targetHttpsProxy = ""; TargetHttpsProxy targetHttpsProxyResource = new TargetHttpsProxy(); // Make the request - Operation response = targetHttpsProxiesClient.Patch(project, targetHttpsProxy, targetHttpsProxyResource); + lro::Operation response = targetHttpsProxiesClient.Patch(project, targetHttpsProxy, targetHttpsProxyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetHttpsProxiesClient.PollOncePatch(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 } @@ -673,7 +850,23 @@ public async Task PatchAsync() string targetHttpsProxy = ""; TargetHttpsProxy targetHttpsProxyResource = new TargetHttpsProxy(); // Make the request - Operation response = await targetHttpsProxiesClient.PatchAsync(project, targetHttpsProxy, targetHttpsProxyResource); + lro::Operation response = await targetHttpsProxiesClient.PatchAsync(project, targetHttpsProxy, targetHttpsProxyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetHttpsProxiesClient.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 } @@ -692,7 +885,23 @@ public void SetQuicOverrideRequestObject() Project = "", }; // Make the request - Operation response = targetHttpsProxiesClient.SetQuicOverride(request); + lro::Operation response = targetHttpsProxiesClient.SetQuicOverride(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetHttpsProxiesClient.PollOnceSetQuicOverride(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 } @@ -712,7 +921,23 @@ public async Task SetQuicOverrideRequestObjectAsync() Project = "", }; // Make the request - Operation response = await targetHttpsProxiesClient.SetQuicOverrideAsync(request); + lro::Operation response = await targetHttpsProxiesClient.SetQuicOverrideAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetHttpsProxiesClient.PollOnceSetQuicOverrideAsync(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 } @@ -727,7 +952,23 @@ public void SetQuicOverride() string targetHttpsProxy = ""; TargetHttpsProxiesSetQuicOverrideRequest targetHttpsProxiesSetQuicOverrideRequestResource = new TargetHttpsProxiesSetQuicOverrideRequest(); // Make the request - Operation response = targetHttpsProxiesClient.SetQuicOverride(project, targetHttpsProxy, targetHttpsProxiesSetQuicOverrideRequestResource); + lro::Operation response = targetHttpsProxiesClient.SetQuicOverride(project, targetHttpsProxy, targetHttpsProxiesSetQuicOverrideRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetHttpsProxiesClient.PollOnceSetQuicOverride(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 } @@ -743,7 +984,23 @@ public async Task SetQuicOverrideAsync() string targetHttpsProxy = ""; TargetHttpsProxiesSetQuicOverrideRequest targetHttpsProxiesSetQuicOverrideRequestResource = new TargetHttpsProxiesSetQuicOverrideRequest(); // Make the request - Operation response = await targetHttpsProxiesClient.SetQuicOverrideAsync(project, targetHttpsProxy, targetHttpsProxiesSetQuicOverrideRequestResource); + lro::Operation response = await targetHttpsProxiesClient.SetQuicOverrideAsync(project, targetHttpsProxy, targetHttpsProxiesSetQuicOverrideRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetHttpsProxiesClient.PollOnceSetQuicOverrideAsync(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 } @@ -762,7 +1019,23 @@ public void SetSslCertificatesRequestObject() Project = "", }; // Make the request - Operation response = targetHttpsProxiesClient.SetSslCertificates(request); + lro::Operation response = targetHttpsProxiesClient.SetSslCertificates(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetHttpsProxiesClient.PollOnceSetSslCertificates(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 } @@ -782,7 +1055,23 @@ public async Task SetSslCertificatesRequestObjectAsync() Project = "", }; // Make the request - Operation response = await targetHttpsProxiesClient.SetSslCertificatesAsync(request); + lro::Operation response = await targetHttpsProxiesClient.SetSslCertificatesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetHttpsProxiesClient.PollOnceSetSslCertificatesAsync(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 } @@ -797,7 +1086,23 @@ public void SetSslCertificates() string targetHttpsProxy = ""; TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = new TargetHttpsProxiesSetSslCertificatesRequest(); // Make the request - Operation response = targetHttpsProxiesClient.SetSslCertificates(project, targetHttpsProxy, targetHttpsProxiesSetSslCertificatesRequestResource); + lro::Operation response = targetHttpsProxiesClient.SetSslCertificates(project, targetHttpsProxy, targetHttpsProxiesSetSslCertificatesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetHttpsProxiesClient.PollOnceSetSslCertificates(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 } @@ -813,7 +1118,23 @@ public async Task SetSslCertificatesAsync() string targetHttpsProxy = ""; TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource = new TargetHttpsProxiesSetSslCertificatesRequest(); // Make the request - Operation response = await targetHttpsProxiesClient.SetSslCertificatesAsync(project, targetHttpsProxy, targetHttpsProxiesSetSslCertificatesRequestResource); + lro::Operation response = await targetHttpsProxiesClient.SetSslCertificatesAsync(project, targetHttpsProxy, targetHttpsProxiesSetSslCertificatesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetHttpsProxiesClient.PollOnceSetSslCertificatesAsync(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 } @@ -832,7 +1153,23 @@ public void SetSslPolicyRequestObject() SslPolicyReferenceResource = new SslPolicyReference(), }; // Make the request - Operation response = targetHttpsProxiesClient.SetSslPolicy(request); + lro::Operation response = targetHttpsProxiesClient.SetSslPolicy(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetHttpsProxiesClient.PollOnceSetSslPolicy(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 } @@ -852,7 +1189,23 @@ public async Task SetSslPolicyRequestObjectAsync() SslPolicyReferenceResource = new SslPolicyReference(), }; // Make the request - Operation response = await targetHttpsProxiesClient.SetSslPolicyAsync(request); + lro::Operation response = await targetHttpsProxiesClient.SetSslPolicyAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetHttpsProxiesClient.PollOnceSetSslPolicyAsync(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 } @@ -867,7 +1220,23 @@ public void SetSslPolicy() string targetHttpsProxy = ""; SslPolicyReference sslPolicyReferenceResource = new SslPolicyReference(); // Make the request - Operation response = targetHttpsProxiesClient.SetSslPolicy(project, targetHttpsProxy, sslPolicyReferenceResource); + lro::Operation response = targetHttpsProxiesClient.SetSslPolicy(project, targetHttpsProxy, sslPolicyReferenceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetHttpsProxiesClient.PollOnceSetSslPolicy(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 } @@ -883,7 +1252,23 @@ public async Task SetSslPolicyAsync() string targetHttpsProxy = ""; SslPolicyReference sslPolicyReferenceResource = new SslPolicyReference(); // Make the request - Operation response = await targetHttpsProxiesClient.SetSslPolicyAsync(project, targetHttpsProxy, sslPolicyReferenceResource); + lro::Operation response = await targetHttpsProxiesClient.SetSslPolicyAsync(project, targetHttpsProxy, sslPolicyReferenceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetHttpsProxiesClient.PollOnceSetSslPolicyAsync(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 } @@ -902,7 +1287,23 @@ public void SetUrlMapRequestObject() UrlMapReferenceResource = new UrlMapReference(), }; // Make the request - Operation response = targetHttpsProxiesClient.SetUrlMap(request); + lro::Operation response = targetHttpsProxiesClient.SetUrlMap(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetHttpsProxiesClient.PollOnceSetUrlMap(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 } @@ -922,7 +1323,23 @@ public async Task SetUrlMapRequestObjectAsync() UrlMapReferenceResource = new UrlMapReference(), }; // Make the request - Operation response = await targetHttpsProxiesClient.SetUrlMapAsync(request); + lro::Operation response = await targetHttpsProxiesClient.SetUrlMapAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetHttpsProxiesClient.PollOnceSetUrlMapAsync(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 } @@ -937,7 +1354,23 @@ public void SetUrlMap() string targetHttpsProxy = ""; UrlMapReference urlMapReferenceResource = new UrlMapReference(); // Make the request - Operation response = targetHttpsProxiesClient.SetUrlMap(project, targetHttpsProxy, urlMapReferenceResource); + lro::Operation response = targetHttpsProxiesClient.SetUrlMap(project, targetHttpsProxy, urlMapReferenceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetHttpsProxiesClient.PollOnceSetUrlMap(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 } @@ -953,7 +1386,23 @@ public async Task SetUrlMapAsync() string targetHttpsProxy = ""; UrlMapReference urlMapReferenceResource = new UrlMapReference(); // Make the request - Operation response = await targetHttpsProxiesClient.SetUrlMapAsync(project, targetHttpsProxy, urlMapReferenceResource); + lro::Operation response = await targetHttpsProxiesClient.SetUrlMapAsync(project, targetHttpsProxy, urlMapReferenceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetHttpsProxiesClient.PollOnceSetUrlMapAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetInstancesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetInstancesClientSnippets.g.cs index 4572837bf86e..1741a1368fe9 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetInstancesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetInstancesClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedTargetInstancesClientSnippets @@ -234,7 +235,23 @@ public void DeleteRequestObject() TargetInstance = "", }; // Make the request - Operation response = targetInstancesClient.Delete(request); + lro::Operation response = targetInstancesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetInstancesClient.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 } @@ -254,7 +271,23 @@ public async Task DeleteRequestObjectAsync() TargetInstance = "", }; // Make the request - Operation response = await targetInstancesClient.DeleteAsync(request); + lro::Operation response = await targetInstancesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetInstancesClient.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 } @@ -269,7 +302,23 @@ public void Delete() string zone = ""; string targetInstance = ""; // Make the request - Operation response = targetInstancesClient.Delete(project, zone, targetInstance); + lro::Operation response = targetInstancesClient.Delete(project, zone, targetInstance); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetInstancesClient.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 } @@ -285,7 +334,23 @@ public async Task DeleteAsync() string zone = ""; string targetInstance = ""; // Make the request - Operation response = await targetInstancesClient.DeleteAsync(project, zone, targetInstance); + lro::Operation response = await targetInstancesClient.DeleteAsync(project, zone, targetInstance); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetInstancesClient.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 } @@ -372,7 +437,23 @@ public void InsertRequestObject() TargetInstanceResource = new TargetInstance(), }; // Make the request - Operation response = targetInstancesClient.Insert(request); + lro::Operation response = targetInstancesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetInstancesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -392,7 +473,23 @@ public async Task InsertRequestObjectAsync() TargetInstanceResource = new TargetInstance(), }; // Make the request - Operation response = await targetInstancesClient.InsertAsync(request); + lro::Operation response = await targetInstancesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetInstancesClient.PollOnceInsertAsync(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 } @@ -407,7 +504,23 @@ public void Insert() string zone = ""; TargetInstance targetInstanceResource = new TargetInstance(); // Make the request - Operation response = targetInstancesClient.Insert(project, zone, targetInstanceResource); + lro::Operation response = targetInstancesClient.Insert(project, zone, targetInstanceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetInstancesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -423,7 +536,23 @@ public async Task InsertAsync() string zone = ""; TargetInstance targetInstanceResource = new TargetInstance(); // Make the request - Operation response = await targetInstancesClient.InsertAsync(project, zone, targetInstanceResource); + lro::Operation response = await targetInstancesClient.InsertAsync(project, zone, targetInstanceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetInstancesClient.PollOnceInsertAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetPoolsClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetPoolsClientSnippets.g.cs index d587ac12ffb7..3becad87a569 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetPoolsClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetPoolsClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedTargetPoolsClientSnippets @@ -41,7 +42,23 @@ public void AddHealthCheckRequestObject() TargetPoolsAddHealthCheckRequestResource = new TargetPoolsAddHealthCheckRequest(), }; // Make the request - Operation response = targetPoolsClient.AddHealthCheck(request); + lro::Operation response = targetPoolsClient.AddHealthCheck(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetPoolsClient.PollOnceAddHealthCheck(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 } @@ -62,7 +79,23 @@ public async Task AddHealthCheckRequestObjectAsync() TargetPoolsAddHealthCheckRequestResource = new TargetPoolsAddHealthCheckRequest(), }; // Make the request - Operation response = await targetPoolsClient.AddHealthCheckAsync(request); + lro::Operation response = await targetPoolsClient.AddHealthCheckAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetPoolsClient.PollOnceAddHealthCheckAsync(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 } @@ -78,7 +111,23 @@ public void AddHealthCheck() string targetPool = ""; TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = new TargetPoolsAddHealthCheckRequest(); // Make the request - Operation response = targetPoolsClient.AddHealthCheck(project, region, targetPool, targetPoolsAddHealthCheckRequestResource); + lro::Operation response = targetPoolsClient.AddHealthCheck(project, region, targetPool, targetPoolsAddHealthCheckRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetPoolsClient.PollOnceAddHealthCheck(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 } @@ -95,7 +144,23 @@ public async Task AddHealthCheckAsync() string targetPool = ""; TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = new TargetPoolsAddHealthCheckRequest(); // Make the request - Operation response = await targetPoolsClient.AddHealthCheckAsync(project, region, targetPool, targetPoolsAddHealthCheckRequestResource); + lro::Operation response = await targetPoolsClient.AddHealthCheckAsync(project, region, targetPool, targetPoolsAddHealthCheckRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetPoolsClient.PollOnceAddHealthCheckAsync(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 } @@ -115,7 +180,23 @@ public void AddInstanceRequestObject() TargetPoolsAddInstanceRequestResource = new TargetPoolsAddInstanceRequest(), }; // Make the request - Operation response = targetPoolsClient.AddInstance(request); + lro::Operation response = targetPoolsClient.AddInstance(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetPoolsClient.PollOnceAddInstance(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 } @@ -136,7 +217,23 @@ public async Task AddInstanceRequestObjectAsync() TargetPoolsAddInstanceRequestResource = new TargetPoolsAddInstanceRequest(), }; // Make the request - Operation response = await targetPoolsClient.AddInstanceAsync(request); + lro::Operation response = await targetPoolsClient.AddInstanceAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetPoolsClient.PollOnceAddInstanceAsync(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 } @@ -152,7 +249,23 @@ public void AddInstance() string targetPool = ""; TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = new TargetPoolsAddInstanceRequest(); // Make the request - Operation response = targetPoolsClient.AddInstance(project, region, targetPool, targetPoolsAddInstanceRequestResource); + lro::Operation response = targetPoolsClient.AddInstance(project, region, targetPool, targetPoolsAddInstanceRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetPoolsClient.PollOnceAddInstance(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 } @@ -169,7 +282,23 @@ public async Task AddInstanceAsync() string targetPool = ""; TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource = new TargetPoolsAddInstanceRequest(); // Make the request - Operation response = await targetPoolsClient.AddInstanceAsync(project, region, targetPool, targetPoolsAddInstanceRequestResource); + lro::Operation response = await targetPoolsClient.AddInstanceAsync(project, region, targetPool, targetPoolsAddInstanceRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetPoolsClient.PollOnceAddInstanceAsync(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 } @@ -382,7 +511,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = targetPoolsClient.Delete(request); + lro::Operation response = targetPoolsClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetPoolsClient.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 } @@ -402,7 +547,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await targetPoolsClient.DeleteAsync(request); + lro::Operation response = await targetPoolsClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetPoolsClient.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 } @@ -417,7 +578,23 @@ public void Delete() string region = ""; string targetPool = ""; // Make the request - Operation response = targetPoolsClient.Delete(project, region, targetPool); + lro::Operation response = targetPoolsClient.Delete(project, region, targetPool); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetPoolsClient.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 } @@ -433,7 +610,23 @@ public async Task DeleteAsync() string region = ""; string targetPool = ""; // Make the request - Operation response = await targetPoolsClient.DeleteAsync(project, region, targetPool); + lro::Operation response = await targetPoolsClient.DeleteAsync(project, region, targetPool); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetPoolsClient.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 } @@ -592,7 +785,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = targetPoolsClient.Insert(request); + lro::Operation response = targetPoolsClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetPoolsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -612,7 +821,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await targetPoolsClient.InsertAsync(request); + lro::Operation response = await targetPoolsClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetPoolsClient.PollOnceInsertAsync(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 } @@ -627,7 +852,23 @@ public void Insert() string region = ""; TargetPool targetPoolResource = new TargetPool(); // Make the request - Operation response = targetPoolsClient.Insert(project, region, targetPoolResource); + lro::Operation response = targetPoolsClient.Insert(project, region, targetPoolResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetPoolsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -643,7 +884,23 @@ public async Task InsertAsync() string region = ""; TargetPool targetPoolResource = new TargetPool(); // Make the request - Operation response = await targetPoolsClient.InsertAsync(project, region, targetPoolResource); + lro::Operation response = await targetPoolsClient.InsertAsync(project, region, targetPoolResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetPoolsClient.PollOnceInsertAsync(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 } @@ -859,7 +1116,23 @@ public void RemoveHealthCheckRequestObject() TargetPoolsRemoveHealthCheckRequestResource = new TargetPoolsRemoveHealthCheckRequest(), }; // Make the request - Operation response = targetPoolsClient.RemoveHealthCheck(request); + lro::Operation response = targetPoolsClient.RemoveHealthCheck(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetPoolsClient.PollOnceRemoveHealthCheck(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 } @@ -880,7 +1153,23 @@ public async Task RemoveHealthCheckRequestObjectAsync() TargetPoolsRemoveHealthCheckRequestResource = new TargetPoolsRemoveHealthCheckRequest(), }; // Make the request - Operation response = await targetPoolsClient.RemoveHealthCheckAsync(request); + lro::Operation response = await targetPoolsClient.RemoveHealthCheckAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetPoolsClient.PollOnceRemoveHealthCheckAsync(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 } @@ -896,7 +1185,23 @@ public void RemoveHealthCheck() string targetPool = ""; TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = new TargetPoolsRemoveHealthCheckRequest(); // Make the request - Operation response = targetPoolsClient.RemoveHealthCheck(project, region, targetPool, targetPoolsRemoveHealthCheckRequestResource); + lro::Operation response = targetPoolsClient.RemoveHealthCheck(project, region, targetPool, targetPoolsRemoveHealthCheckRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetPoolsClient.PollOnceRemoveHealthCheck(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 } @@ -913,7 +1218,23 @@ public async Task RemoveHealthCheckAsync() string targetPool = ""; TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = new TargetPoolsRemoveHealthCheckRequest(); // Make the request - Operation response = await targetPoolsClient.RemoveHealthCheckAsync(project, region, targetPool, targetPoolsRemoveHealthCheckRequestResource); + lro::Operation response = await targetPoolsClient.RemoveHealthCheckAsync(project, region, targetPool, targetPoolsRemoveHealthCheckRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetPoolsClient.PollOnceRemoveHealthCheckAsync(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 } @@ -933,7 +1254,23 @@ public void RemoveInstanceRequestObject() Project = "", }; // Make the request - Operation response = targetPoolsClient.RemoveInstance(request); + lro::Operation response = targetPoolsClient.RemoveInstance(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetPoolsClient.PollOnceRemoveInstance(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 } @@ -954,7 +1291,23 @@ public async Task RemoveInstanceRequestObjectAsync() Project = "", }; // Make the request - Operation response = await targetPoolsClient.RemoveInstanceAsync(request); + lro::Operation response = await targetPoolsClient.RemoveInstanceAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetPoolsClient.PollOnceRemoveInstanceAsync(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 } @@ -970,7 +1323,23 @@ public void RemoveInstance() string targetPool = ""; TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = new TargetPoolsRemoveInstanceRequest(); // Make the request - Operation response = targetPoolsClient.RemoveInstance(project, region, targetPool, targetPoolsRemoveInstanceRequestResource); + lro::Operation response = targetPoolsClient.RemoveInstance(project, region, targetPool, targetPoolsRemoveInstanceRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetPoolsClient.PollOnceRemoveInstance(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 } @@ -987,7 +1356,23 @@ public async Task RemoveInstanceAsync() string targetPool = ""; TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = new TargetPoolsRemoveInstanceRequest(); // Make the request - Operation response = await targetPoolsClient.RemoveInstanceAsync(project, region, targetPool, targetPoolsRemoveInstanceRequestResource); + lro::Operation response = await targetPoolsClient.RemoveInstanceAsync(project, region, targetPool, targetPoolsRemoveInstanceRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetPoolsClient.PollOnceRemoveInstanceAsync(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 } @@ -1008,7 +1393,23 @@ public void SetBackupRequestObject() TargetReferenceResource = new TargetReference(), }; // Make the request - Operation response = targetPoolsClient.SetBackup(request); + lro::Operation response = targetPoolsClient.SetBackup(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetPoolsClient.PollOnceSetBackup(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 } @@ -1030,7 +1431,23 @@ public async Task SetBackupRequestObjectAsync() TargetReferenceResource = new TargetReference(), }; // Make the request - Operation response = await targetPoolsClient.SetBackupAsync(request); + lro::Operation response = await targetPoolsClient.SetBackupAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetPoolsClient.PollOnceSetBackupAsync(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 } @@ -1046,7 +1463,23 @@ public void SetBackup() string targetPool = ""; TargetReference targetReferenceResource = new TargetReference(); // Make the request - Operation response = targetPoolsClient.SetBackup(project, region, targetPool, targetReferenceResource); + lro::Operation response = targetPoolsClient.SetBackup(project, region, targetPool, targetReferenceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetPoolsClient.PollOnceSetBackup(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 } @@ -1063,7 +1496,23 @@ public async Task SetBackupAsync() string targetPool = ""; TargetReference targetReferenceResource = new TargetReference(); // Make the request - Operation response = await targetPoolsClient.SetBackupAsync(project, region, targetPool, targetReferenceResource); + lro::Operation response = await targetPoolsClient.SetBackupAsync(project, region, targetPool, targetReferenceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetPoolsClient.PollOnceSetBackupAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetSslProxiesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetSslProxiesClientSnippets.g.cs index b89e51189297..4dba69d85d20 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetSslProxiesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetSslProxiesClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedTargetSslProxiesClientSnippets @@ -38,7 +39,23 @@ public void DeleteRequestObject() TargetSslProxy = "", }; // Make the request - Operation response = targetSslProxiesClient.Delete(request); + lro::Operation response = targetSslProxiesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetSslProxiesClient.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 } @@ -57,7 +74,23 @@ public async Task DeleteRequestObjectAsync() TargetSslProxy = "", }; // Make the request - Operation response = await targetSslProxiesClient.DeleteAsync(request); + lro::Operation response = await targetSslProxiesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetSslProxiesClient.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 } @@ -71,7 +104,23 @@ public void Delete() string project = ""; string targetSslProxy = ""; // Make the request - Operation response = targetSslProxiesClient.Delete(project, targetSslProxy); + lro::Operation response = targetSslProxiesClient.Delete(project, targetSslProxy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetSslProxiesClient.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 } @@ -86,7 +135,23 @@ public async Task DeleteAsync() string project = ""; string targetSslProxy = ""; // Make the request - Operation response = await targetSslProxiesClient.DeleteAsync(project, targetSslProxy); + lro::Operation response = await targetSslProxiesClient.DeleteAsync(project, targetSslProxy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetSslProxiesClient.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 } @@ -168,7 +233,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = targetSslProxiesClient.Insert(request); + lro::Operation response = targetSslProxiesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetSslProxiesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -187,7 +268,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await targetSslProxiesClient.InsertAsync(request); + lro::Operation response = await targetSslProxiesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetSslProxiesClient.PollOnceInsertAsync(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 } @@ -201,7 +298,23 @@ public void Insert() string project = ""; TargetSslProxy targetSslProxyResource = new TargetSslProxy(); // Make the request - Operation response = targetSslProxiesClient.Insert(project, targetSslProxyResource); + lro::Operation response = targetSslProxiesClient.Insert(project, targetSslProxyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetSslProxiesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -216,7 +329,23 @@ public async Task InsertAsync() string project = ""; TargetSslProxy targetSslProxyResource = new TargetSslProxy(); // Make the request - Operation response = await targetSslProxiesClient.InsertAsync(project, targetSslProxyResource); + lro::Operation response = await targetSslProxiesClient.InsertAsync(project, targetSslProxyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetSslProxiesClient.PollOnceInsertAsync(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 } @@ -427,7 +556,23 @@ public void SetBackendServiceRequestObject() TargetSslProxy = "", }; // Make the request - Operation response = targetSslProxiesClient.SetBackendService(request); + lro::Operation response = targetSslProxiesClient.SetBackendService(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetSslProxiesClient.PollOnceSetBackendService(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 } @@ -447,7 +592,23 @@ public async Task SetBackendServiceRequestObjectAsync() TargetSslProxy = "", }; // Make the request - Operation response = await targetSslProxiesClient.SetBackendServiceAsync(request); + lro::Operation response = await targetSslProxiesClient.SetBackendServiceAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetSslProxiesClient.PollOnceSetBackendServiceAsync(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 } @@ -462,7 +623,23 @@ public void SetBackendService() string targetSslProxy = ""; TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = new TargetSslProxiesSetBackendServiceRequest(); // Make the request - Operation response = targetSslProxiesClient.SetBackendService(project, targetSslProxy, targetSslProxiesSetBackendServiceRequestResource); + lro::Operation response = targetSslProxiesClient.SetBackendService(project, targetSslProxy, targetSslProxiesSetBackendServiceRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetSslProxiesClient.PollOnceSetBackendService(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 } @@ -478,7 +655,23 @@ public async Task SetBackendServiceAsync() string targetSslProxy = ""; TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource = new TargetSslProxiesSetBackendServiceRequest(); // Make the request - Operation response = await targetSslProxiesClient.SetBackendServiceAsync(project, targetSslProxy, targetSslProxiesSetBackendServiceRequestResource); + lro::Operation response = await targetSslProxiesClient.SetBackendServiceAsync(project, targetSslProxy, targetSslProxiesSetBackendServiceRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetSslProxiesClient.PollOnceSetBackendServiceAsync(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 } @@ -497,7 +690,23 @@ public void SetProxyHeaderRequestObject() TargetSslProxy = "", }; // Make the request - Operation response = targetSslProxiesClient.SetProxyHeader(request); + lro::Operation response = targetSslProxiesClient.SetProxyHeader(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetSslProxiesClient.PollOnceSetProxyHeader(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 } @@ -517,7 +726,23 @@ public async Task SetProxyHeaderRequestObjectAsync() TargetSslProxy = "", }; // Make the request - Operation response = await targetSslProxiesClient.SetProxyHeaderAsync(request); + lro::Operation response = await targetSslProxiesClient.SetProxyHeaderAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetSslProxiesClient.PollOnceSetProxyHeaderAsync(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 } @@ -532,7 +757,23 @@ public void SetProxyHeader() string targetSslProxy = ""; TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = new TargetSslProxiesSetProxyHeaderRequest(); // Make the request - Operation response = targetSslProxiesClient.SetProxyHeader(project, targetSslProxy, targetSslProxiesSetProxyHeaderRequestResource); + lro::Operation response = targetSslProxiesClient.SetProxyHeader(project, targetSslProxy, targetSslProxiesSetProxyHeaderRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetSslProxiesClient.PollOnceSetProxyHeader(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 } @@ -548,7 +789,23 @@ public async Task SetProxyHeaderAsync() string targetSslProxy = ""; TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource = new TargetSslProxiesSetProxyHeaderRequest(); // Make the request - Operation response = await targetSslProxiesClient.SetProxyHeaderAsync(project, targetSslProxy, targetSslProxiesSetProxyHeaderRequestResource); + lro::Operation response = await targetSslProxiesClient.SetProxyHeaderAsync(project, targetSslProxy, targetSslProxiesSetProxyHeaderRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetSslProxiesClient.PollOnceSetProxyHeaderAsync(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 } @@ -567,7 +824,23 @@ public void SetSslCertificatesRequestObject() TargetSslProxy = "", }; // Make the request - Operation response = targetSslProxiesClient.SetSslCertificates(request); + lro::Operation response = targetSslProxiesClient.SetSslCertificates(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetSslProxiesClient.PollOnceSetSslCertificates(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 } @@ -587,7 +860,23 @@ public async Task SetSslCertificatesRequestObjectAsync() TargetSslProxy = "", }; // Make the request - Operation response = await targetSslProxiesClient.SetSslCertificatesAsync(request); + lro::Operation response = await targetSslProxiesClient.SetSslCertificatesAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetSslProxiesClient.PollOnceSetSslCertificatesAsync(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 } @@ -602,7 +891,23 @@ public void SetSslCertificates() string targetSslProxy = ""; TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = new TargetSslProxiesSetSslCertificatesRequest(); // Make the request - Operation response = targetSslProxiesClient.SetSslCertificates(project, targetSslProxy, targetSslProxiesSetSslCertificatesRequestResource); + lro::Operation response = targetSslProxiesClient.SetSslCertificates(project, targetSslProxy, targetSslProxiesSetSslCertificatesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetSslProxiesClient.PollOnceSetSslCertificates(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 } @@ -618,7 +923,23 @@ public async Task SetSslCertificatesAsync() string targetSslProxy = ""; TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource = new TargetSslProxiesSetSslCertificatesRequest(); // Make the request - Operation response = await targetSslProxiesClient.SetSslCertificatesAsync(project, targetSslProxy, targetSslProxiesSetSslCertificatesRequestResource); + lro::Operation response = await targetSslProxiesClient.SetSslCertificatesAsync(project, targetSslProxy, targetSslProxiesSetSslCertificatesRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetSslProxiesClient.PollOnceSetSslCertificatesAsync(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 } @@ -637,7 +958,23 @@ public void SetSslPolicyRequestObject() TargetSslProxy = "", }; // Make the request - Operation response = targetSslProxiesClient.SetSslPolicy(request); + lro::Operation response = targetSslProxiesClient.SetSslPolicy(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetSslProxiesClient.PollOnceSetSslPolicy(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 } @@ -657,7 +994,23 @@ public async Task SetSslPolicyRequestObjectAsync() TargetSslProxy = "", }; // Make the request - Operation response = await targetSslProxiesClient.SetSslPolicyAsync(request); + lro::Operation response = await targetSslProxiesClient.SetSslPolicyAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetSslProxiesClient.PollOnceSetSslPolicyAsync(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 } @@ -672,7 +1025,23 @@ public void SetSslPolicy() string targetSslProxy = ""; SslPolicyReference sslPolicyReferenceResource = new SslPolicyReference(); // Make the request - Operation response = targetSslProxiesClient.SetSslPolicy(project, targetSslProxy, sslPolicyReferenceResource); + lro::Operation response = targetSslProxiesClient.SetSslPolicy(project, targetSslProxy, sslPolicyReferenceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetSslProxiesClient.PollOnceSetSslPolicy(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 } @@ -688,7 +1057,23 @@ public async Task SetSslPolicyAsync() string targetSslProxy = ""; SslPolicyReference sslPolicyReferenceResource = new SslPolicyReference(); // Make the request - Operation response = await targetSslProxiesClient.SetSslPolicyAsync(project, targetSslProxy, sslPolicyReferenceResource); + lro::Operation response = await targetSslProxiesClient.SetSslPolicyAsync(project, targetSslProxy, sslPolicyReferenceResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetSslProxiesClient.PollOnceSetSslPolicyAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetTcpProxiesClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetTcpProxiesClientSnippets.g.cs index 216102220f84..5d6aa43e99ab 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetTcpProxiesClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetTcpProxiesClientSnippets.g.cs @@ -20,6 +20,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedTargetTcpProxiesClientSnippets @@ -38,7 +39,23 @@ public void DeleteRequestObject() TargetTcpProxy = "", }; // Make the request - Operation response = targetTcpProxiesClient.Delete(request); + lro::Operation response = targetTcpProxiesClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetTcpProxiesClient.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 } @@ -57,7 +74,23 @@ public async Task DeleteRequestObjectAsync() TargetTcpProxy = "", }; // Make the request - Operation response = await targetTcpProxiesClient.DeleteAsync(request); + lro::Operation response = await targetTcpProxiesClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetTcpProxiesClient.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 } @@ -71,7 +104,23 @@ public void Delete() string project = ""; string targetTcpProxy = ""; // Make the request - Operation response = targetTcpProxiesClient.Delete(project, targetTcpProxy); + lro::Operation response = targetTcpProxiesClient.Delete(project, targetTcpProxy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetTcpProxiesClient.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 } @@ -86,7 +135,23 @@ public async Task DeleteAsync() string project = ""; string targetTcpProxy = ""; // Make the request - Operation response = await targetTcpProxiesClient.DeleteAsync(project, targetTcpProxy); + lro::Operation response = await targetTcpProxiesClient.DeleteAsync(project, targetTcpProxy); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetTcpProxiesClient.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 } @@ -168,7 +233,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = targetTcpProxiesClient.Insert(request); + lro::Operation response = targetTcpProxiesClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetTcpProxiesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -187,7 +268,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await targetTcpProxiesClient.InsertAsync(request); + lro::Operation response = await targetTcpProxiesClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetTcpProxiesClient.PollOnceInsertAsync(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 } @@ -201,7 +298,23 @@ public void Insert() string project = ""; TargetTcpProxy targetTcpProxyResource = new TargetTcpProxy(); // Make the request - Operation response = targetTcpProxiesClient.Insert(project, targetTcpProxyResource); + lro::Operation response = targetTcpProxiesClient.Insert(project, targetTcpProxyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetTcpProxiesClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -216,7 +329,23 @@ public async Task InsertAsync() string project = ""; TargetTcpProxy targetTcpProxyResource = new TargetTcpProxy(); // Make the request - Operation response = await targetTcpProxiesClient.InsertAsync(project, targetTcpProxyResource); + lro::Operation response = await targetTcpProxiesClient.InsertAsync(project, targetTcpProxyResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetTcpProxiesClient.PollOnceInsertAsync(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 } @@ -427,7 +556,23 @@ public void SetBackendServiceRequestObject() TargetTcpProxy = "", }; // Make the request - Operation response = targetTcpProxiesClient.SetBackendService(request); + lro::Operation response = targetTcpProxiesClient.SetBackendService(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetTcpProxiesClient.PollOnceSetBackendService(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 } @@ -447,7 +592,23 @@ public async Task SetBackendServiceRequestObjectAsync() TargetTcpProxy = "", }; // Make the request - Operation response = await targetTcpProxiesClient.SetBackendServiceAsync(request); + lro::Operation response = await targetTcpProxiesClient.SetBackendServiceAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetTcpProxiesClient.PollOnceSetBackendServiceAsync(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 } @@ -462,7 +623,23 @@ public void SetBackendService() string targetTcpProxy = ""; TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = new TargetTcpProxiesSetBackendServiceRequest(); // Make the request - Operation response = targetTcpProxiesClient.SetBackendService(project, targetTcpProxy, targetTcpProxiesSetBackendServiceRequestResource); + lro::Operation response = targetTcpProxiesClient.SetBackendService(project, targetTcpProxy, targetTcpProxiesSetBackendServiceRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetTcpProxiesClient.PollOnceSetBackendService(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 } @@ -478,7 +655,23 @@ public async Task SetBackendServiceAsync() string targetTcpProxy = ""; TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource = new TargetTcpProxiesSetBackendServiceRequest(); // Make the request - Operation response = await targetTcpProxiesClient.SetBackendServiceAsync(project, targetTcpProxy, targetTcpProxiesSetBackendServiceRequestResource); + lro::Operation response = await targetTcpProxiesClient.SetBackendServiceAsync(project, targetTcpProxy, targetTcpProxiesSetBackendServiceRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetTcpProxiesClient.PollOnceSetBackendServiceAsync(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 } @@ -497,7 +690,23 @@ public void SetProxyHeaderRequestObject() TargetTcpProxy = "", }; // Make the request - Operation response = targetTcpProxiesClient.SetProxyHeader(request); + lro::Operation response = targetTcpProxiesClient.SetProxyHeader(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetTcpProxiesClient.PollOnceSetProxyHeader(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 } @@ -517,7 +726,23 @@ public async Task SetProxyHeaderRequestObjectAsync() TargetTcpProxy = "", }; // Make the request - Operation response = await targetTcpProxiesClient.SetProxyHeaderAsync(request); + lro::Operation response = await targetTcpProxiesClient.SetProxyHeaderAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetTcpProxiesClient.PollOnceSetProxyHeaderAsync(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 } @@ -532,7 +757,23 @@ public void SetProxyHeader() string targetTcpProxy = ""; TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = new TargetTcpProxiesSetProxyHeaderRequest(); // Make the request - Operation response = targetTcpProxiesClient.SetProxyHeader(project, targetTcpProxy, targetTcpProxiesSetProxyHeaderRequestResource); + lro::Operation response = targetTcpProxiesClient.SetProxyHeader(project, targetTcpProxy, targetTcpProxiesSetProxyHeaderRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetTcpProxiesClient.PollOnceSetProxyHeader(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 } @@ -548,7 +789,23 @@ public async Task SetProxyHeaderAsync() string targetTcpProxy = ""; TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource = new TargetTcpProxiesSetProxyHeaderRequest(); // Make the request - Operation response = await targetTcpProxiesClient.SetProxyHeaderAsync(project, targetTcpProxy, targetTcpProxiesSetProxyHeaderRequestResource); + lro::Operation response = await targetTcpProxiesClient.SetProxyHeaderAsync(project, targetTcpProxy, targetTcpProxiesSetProxyHeaderRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetTcpProxiesClient.PollOnceSetProxyHeaderAsync(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 } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetVpnGatewaysClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetVpnGatewaysClientSnippets.g.cs index 24705f2ef612..e386fc4770f1 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetVpnGatewaysClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/TargetVpnGatewaysClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedTargetVpnGatewaysClientSnippets @@ -234,7 +235,23 @@ public void DeleteRequestObject() TargetVpnGateway = "", }; // Make the request - Operation response = targetVpnGatewaysClient.Delete(request); + lro::Operation response = targetVpnGatewaysClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetVpnGatewaysClient.PollOnceDelete(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -254,7 +271,23 @@ public async Task DeleteRequestObjectAsync() TargetVpnGateway = "", }; // Make the request - Operation response = await targetVpnGatewaysClient.DeleteAsync(request); + lro::Operation response = await targetVpnGatewaysClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetVpnGatewaysClient.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 } @@ -269,7 +302,23 @@ public void Delete() string region = ""; string targetVpnGateway = ""; // Make the request - Operation response = targetVpnGatewaysClient.Delete(project, region, targetVpnGateway); + lro::Operation response = targetVpnGatewaysClient.Delete(project, region, targetVpnGateway); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetVpnGatewaysClient.PollOnceDelete(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -285,7 +334,23 @@ public async Task DeleteAsync() string region = ""; string targetVpnGateway = ""; // Make the request - Operation response = await targetVpnGatewaysClient.DeleteAsync(project, region, targetVpnGateway); + lro::Operation response = await targetVpnGatewaysClient.DeleteAsync(project, region, targetVpnGateway); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetVpnGatewaysClient.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 } @@ -372,7 +437,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = targetVpnGatewaysClient.Insert(request); + lro::Operation response = targetVpnGatewaysClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetVpnGatewaysClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -392,7 +473,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await targetVpnGatewaysClient.InsertAsync(request); + lro::Operation response = await targetVpnGatewaysClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetVpnGatewaysClient.PollOnceInsertAsync(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 } @@ -407,7 +504,23 @@ public void Insert() string region = ""; TargetVpnGateway targetVpnGatewayResource = new TargetVpnGateway(); // Make the request - Operation response = targetVpnGatewaysClient.Insert(project, region, targetVpnGatewayResource); + lro::Operation response = targetVpnGatewaysClient.Insert(project, region, targetVpnGatewayResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = targetVpnGatewaysClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -423,7 +536,23 @@ public async Task InsertAsync() string region = ""; TargetVpnGateway targetVpnGatewayResource = new TargetVpnGateway(); // Make the request - Operation response = await targetVpnGatewaysClient.InsertAsync(project, region, targetVpnGatewayResource); + lro::Operation response = await targetVpnGatewaysClient.InsertAsync(project, region, targetVpnGatewayResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await targetVpnGatewaysClient.PollOnceInsertAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/UrlMapsClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/UrlMapsClientSnippets.g.cs index 39d72c639986..042673149972 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/UrlMapsClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/UrlMapsClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedUrlMapsClientSnippets @@ -233,7 +234,23 @@ public void DeleteRequestObject() UrlMap = "", }; // Make the request - Operation response = urlMapsClient.Delete(request); + lro::Operation response = urlMapsClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = urlMapsClient.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 } @@ -252,7 +269,23 @@ public async Task DeleteRequestObjectAsync() UrlMap = "", }; // Make the request - Operation response = await urlMapsClient.DeleteAsync(request); + lro::Operation response = await urlMapsClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await urlMapsClient.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 } @@ -266,7 +299,23 @@ public void Delete() string project = ""; string urlMap = ""; // Make the request - Operation response = urlMapsClient.Delete(project, urlMap); + lro::Operation response = urlMapsClient.Delete(project, urlMap); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = urlMapsClient.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 } @@ -281,7 +330,23 @@ public async Task DeleteAsync() string project = ""; string urlMap = ""; // Make the request - Operation response = await urlMapsClient.DeleteAsync(project, urlMap); + lro::Operation response = await urlMapsClient.DeleteAsync(project, urlMap); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await urlMapsClient.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 } @@ -363,7 +428,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = urlMapsClient.Insert(request); + lro::Operation response = urlMapsClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = urlMapsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -382,7 +463,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await urlMapsClient.InsertAsync(request); + lro::Operation response = await urlMapsClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await urlMapsClient.PollOnceInsertAsync(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 } @@ -396,7 +493,23 @@ public void Insert() string project = ""; UrlMap urlMapResource = new UrlMap(); // Make the request - Operation response = urlMapsClient.Insert(project, urlMapResource); + lro::Operation response = urlMapsClient.Insert(project, urlMapResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = urlMapsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -411,7 +524,23 @@ public async Task InsertAsync() string project = ""; UrlMap urlMapResource = new UrlMap(); // Make the request - Operation response = await urlMapsClient.InsertAsync(project, urlMapResource); + lro::Operation response = await urlMapsClient.InsertAsync(project, urlMapResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await urlMapsClient.PollOnceInsertAsync(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 } @@ -430,7 +559,23 @@ public void InvalidateCacheRequestObject() UrlMap = "", }; // Make the request - Operation response = urlMapsClient.InvalidateCache(request); + lro::Operation response = urlMapsClient.InvalidateCache(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = urlMapsClient.PollOnceInvalidateCache(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 } @@ -450,7 +595,23 @@ public async Task InvalidateCacheRequestObjectAsync() UrlMap = "", }; // Make the request - Operation response = await urlMapsClient.InvalidateCacheAsync(request); + lro::Operation response = await urlMapsClient.InvalidateCacheAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await urlMapsClient.PollOnceInvalidateCacheAsync(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 } @@ -465,7 +626,23 @@ public void InvalidateCache() string urlMap = ""; CacheInvalidationRule cacheInvalidationRuleResource = new CacheInvalidationRule(); // Make the request - Operation response = urlMapsClient.InvalidateCache(project, urlMap, cacheInvalidationRuleResource); + lro::Operation response = urlMapsClient.InvalidateCache(project, urlMap, cacheInvalidationRuleResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = urlMapsClient.PollOnceInvalidateCache(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 } @@ -481,7 +658,23 @@ public async Task InvalidateCacheAsync() string urlMap = ""; CacheInvalidationRule cacheInvalidationRuleResource = new CacheInvalidationRule(); // Make the request - Operation response = await urlMapsClient.InvalidateCacheAsync(project, urlMap, cacheInvalidationRuleResource); + lro::Operation response = await urlMapsClient.InvalidateCacheAsync(project, urlMap, cacheInvalidationRuleResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await urlMapsClient.PollOnceInvalidateCacheAsync(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 } @@ -692,7 +885,23 @@ public void PatchRequestObject() UrlMap = "", }; // Make the request - Operation response = urlMapsClient.Patch(request); + lro::Operation response = urlMapsClient.Patch(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = urlMapsClient.PollOncePatch(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 } @@ -712,7 +921,23 @@ public async Task PatchRequestObjectAsync() UrlMap = "", }; // Make the request - Operation response = await urlMapsClient.PatchAsync(request); + lro::Operation response = await urlMapsClient.PatchAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await urlMapsClient.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 } @@ -727,7 +952,23 @@ public void Patch() string urlMap = ""; UrlMap urlMapResource = new UrlMap(); // Make the request - Operation response = urlMapsClient.Patch(project, urlMap, urlMapResource); + lro::Operation response = urlMapsClient.Patch(project, urlMap, urlMapResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = urlMapsClient.PollOncePatch(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 } @@ -743,7 +984,23 @@ public async Task PatchAsync() string urlMap = ""; UrlMap urlMapResource = new UrlMap(); // Make the request - Operation response = await urlMapsClient.PatchAsync(project, urlMap, urlMapResource); + lro::Operation response = await urlMapsClient.PatchAsync(project, urlMap, urlMapResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await urlMapsClient.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 } @@ -762,7 +1019,23 @@ public void UpdateRequestObject() UrlMap = "", }; // Make the request - Operation response = urlMapsClient.Update(request); + lro::Operation response = urlMapsClient.Update(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = urlMapsClient.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 } @@ -782,7 +1055,23 @@ public async Task UpdateRequestObjectAsync() UrlMap = "", }; // Make the request - Operation response = await urlMapsClient.UpdateAsync(request); + lro::Operation response = await urlMapsClient.UpdateAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await urlMapsClient.PollOnceUpdateAsync(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 } @@ -797,7 +1086,23 @@ public void Update() string urlMap = ""; UrlMap urlMapResource = new UrlMap(); // Make the request - Operation response = urlMapsClient.Update(project, urlMap, urlMapResource); + lro::Operation response = urlMapsClient.Update(project, urlMap, urlMapResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = urlMapsClient.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 } @@ -813,7 +1118,23 @@ public async Task UpdateAsync() string urlMap = ""; UrlMap urlMapResource = new UrlMap(); // Make the request - Operation response = await urlMapsClient.UpdateAsync(project, urlMap, urlMapResource); + lro::Operation response = await urlMapsClient.UpdateAsync(project, urlMap, urlMapResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await urlMapsClient.PollOnceUpdateAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/VpnGatewaysClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/VpnGatewaysClientSnippets.g.cs index 6275f87ca11c..faefd15dc798 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/VpnGatewaysClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/VpnGatewaysClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedVpnGatewaysClientSnippets @@ -234,7 +235,23 @@ public void DeleteRequestObject() VpnGateway = "", }; // Make the request - Operation response = vpnGatewaysClient.Delete(request); + lro::Operation response = vpnGatewaysClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = vpnGatewaysClient.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 } @@ -254,7 +271,23 @@ public async Task DeleteRequestObjectAsync() VpnGateway = "", }; // Make the request - Operation response = await vpnGatewaysClient.DeleteAsync(request); + lro::Operation response = await vpnGatewaysClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await vpnGatewaysClient.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 } @@ -269,7 +302,23 @@ public void Delete() string region = ""; string vpnGateway = ""; // Make the request - Operation response = vpnGatewaysClient.Delete(project, region, vpnGateway); + lro::Operation response = vpnGatewaysClient.Delete(project, region, vpnGateway); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = vpnGatewaysClient.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 } @@ -285,7 +334,23 @@ public async Task DeleteAsync() string region = ""; string vpnGateway = ""; // Make the request - Operation response = await vpnGatewaysClient.DeleteAsync(project, region, vpnGateway); + lro::Operation response = await vpnGatewaysClient.DeleteAsync(project, region, vpnGateway); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await vpnGatewaysClient.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 } @@ -440,7 +505,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = vpnGatewaysClient.Insert(request); + lro::Operation response = vpnGatewaysClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = vpnGatewaysClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -460,7 +541,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await vpnGatewaysClient.InsertAsync(request); + lro::Operation response = await vpnGatewaysClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await vpnGatewaysClient.PollOnceInsertAsync(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 } @@ -475,7 +572,23 @@ public void Insert() string region = ""; VpnGateway vpnGatewayResource = new VpnGateway(); // Make the request - Operation response = vpnGatewaysClient.Insert(project, region, vpnGatewayResource); + lro::Operation response = vpnGatewaysClient.Insert(project, region, vpnGatewayResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = vpnGatewaysClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -491,7 +604,23 @@ public async Task InsertAsync() string region = ""; VpnGateway vpnGatewayResource = new VpnGateway(); // Make the request - Operation response = await vpnGatewaysClient.InsertAsync(project, region, vpnGatewayResource); + lro::Operation response = await vpnGatewaysClient.InsertAsync(project, region, vpnGatewayResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await vpnGatewaysClient.PollOnceInsertAsync(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 } @@ -707,7 +836,23 @@ public void SetLabelsRequestObject() RegionSetLabelsRequestResource = new RegionSetLabelsRequest(), }; // Make the request - Operation response = vpnGatewaysClient.SetLabels(request); + lro::Operation response = vpnGatewaysClient.SetLabels(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = vpnGatewaysClient.PollOnceSetLabels(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -728,7 +873,23 @@ public async Task SetLabelsRequestObjectAsync() RegionSetLabelsRequestResource = new RegionSetLabelsRequest(), }; // Make the request - Operation response = await vpnGatewaysClient.SetLabelsAsync(request); + lro::Operation response = await vpnGatewaysClient.SetLabelsAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await vpnGatewaysClient.PollOnceSetLabelsAsync(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 } @@ -744,7 +905,23 @@ public void SetLabels() string resource = ""; RegionSetLabelsRequest regionSetLabelsRequestResource = new RegionSetLabelsRequest(); // Make the request - Operation response = vpnGatewaysClient.SetLabels(project, region, resource, regionSetLabelsRequestResource); + lro::Operation response = vpnGatewaysClient.SetLabels(project, region, resource, regionSetLabelsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = vpnGatewaysClient.PollOnceSetLabels(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -761,7 +938,23 @@ public async Task SetLabelsAsync() string resource = ""; RegionSetLabelsRequest regionSetLabelsRequestResource = new RegionSetLabelsRequest(); // Make the request - Operation response = await vpnGatewaysClient.SetLabelsAsync(project, region, resource, regionSetLabelsRequestResource); + lro::Operation response = await vpnGatewaysClient.SetLabelsAsync(project, region, resource, regionSetLabelsRequestResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await vpnGatewaysClient.PollOnceSetLabelsAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/VpnTunnelsClientSnippets.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/VpnTunnelsClientSnippets.g.cs index f3d960302072..ca6560cfbd4e 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/VpnTunnelsClientSnippets.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Snippets/VpnTunnelsClientSnippets.g.cs @@ -21,6 +21,7 @@ namespace Google.Cloud.Compute.V1.Snippets using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using lro = Google.LongRunning; /// Generated snippets. public sealed class GeneratedVpnTunnelsClientSnippets @@ -234,7 +235,23 @@ public void DeleteRequestObject() Project = "", }; // Make the request - Operation response = vpnTunnelsClient.Delete(request); + lro::Operation response = vpnTunnelsClient.Delete(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = vpnTunnelsClient.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 } @@ -254,7 +271,23 @@ public async Task DeleteRequestObjectAsync() Project = "", }; // Make the request - Operation response = await vpnTunnelsClient.DeleteAsync(request); + lro::Operation response = await vpnTunnelsClient.DeleteAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await vpnTunnelsClient.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 } @@ -269,7 +302,23 @@ public void Delete() string region = ""; string vpnTunnel = ""; // Make the request - Operation response = vpnTunnelsClient.Delete(project, region, vpnTunnel); + lro::Operation response = vpnTunnelsClient.Delete(project, region, vpnTunnel); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = vpnTunnelsClient.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 } @@ -285,7 +334,23 @@ public async Task DeleteAsync() string region = ""; string vpnTunnel = ""; // Make the request - Operation response = await vpnTunnelsClient.DeleteAsync(project, region, vpnTunnel); + lro::Operation response = await vpnTunnelsClient.DeleteAsync(project, region, vpnTunnel); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await vpnTunnelsClient.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 } @@ -372,7 +437,23 @@ public void InsertRequestObject() Project = "", }; // Make the request - Operation response = vpnTunnelsClient.Insert(request); + lro::Operation response = vpnTunnelsClient.Insert(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = vpnTunnelsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -392,7 +473,23 @@ public async Task InsertRequestObjectAsync() Project = "", }; // Make the request - Operation response = await vpnTunnelsClient.InsertAsync(request); + lro::Operation response = await vpnTunnelsClient.InsertAsync(request); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await vpnTunnelsClient.PollOnceInsertAsync(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 } @@ -407,7 +504,23 @@ public void Insert() string region = ""; VpnTunnel vpnTunnelResource = new VpnTunnel(); // Make the request - Operation response = vpnTunnelsClient.Insert(project, region, vpnTunnelResource); + lro::Operation response = vpnTunnelsClient.Insert(project, region, vpnTunnelResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = vpnTunnelsClient.PollOnceInsert(operationName); + // Check if the retrieved long-running operation has completed + if (retrievedResponse.IsCompleted) + { + // If it has completed, then access the result + Operation retrievedResult = retrievedResponse.Result; + } // End snippet } @@ -423,7 +536,23 @@ public async Task InsertAsync() string region = ""; VpnTunnel vpnTunnelResource = new VpnTunnel(); // Make the request - Operation response = await vpnTunnelsClient.InsertAsync(project, region, vpnTunnelResource); + lro::Operation response = await vpnTunnelsClient.InsertAsync(project, region, vpnTunnelResource); + + // Poll until the returned long-running operation is complete + lro::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 retrievedResponse = await vpnTunnelsClient.PollOnceInsertAsync(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 } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/AddressesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/AddressesClientTest.g.cs index ebab05498525..9dbbe633cba0 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/AddressesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/AddressesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedAddressesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteAddressRequest request = new DeleteAddressRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - Address = "address04984d88", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - AddressesClient client = new AddressesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteAddressRequest request = new DeleteAddressRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - Address = "address04984d88", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - AddressesClient client = new AddressesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteAddressRequest request = new DeleteAddressRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - Address = "address04984d88", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - AddressesClient client = new AddressesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.Address); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteAddressRequest request = new DeleteAddressRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - Address = "address04984d88", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - AddressesClient client = new AddressesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.Address, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.Address, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetAddressRequest request = new GetAddressRequest { Region = "regionedb20d96", @@ -249,6 +69,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetAddressRequest request = new GetAddressRequest { Region = "regionedb20d96", @@ -288,6 +109,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetAddressRequest request = new GetAddressRequest { Region = "regionedb20d96", @@ -325,6 +147,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetAddressRequest request = new GetAddressRequest { Region = "regionedb20d96", @@ -359,187 +182,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertAddressRequest request = new InsertAddressRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - AddressResource = new Address(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - AddressesClient client = new AddressesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertAddressRequest request = new InsertAddressRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - AddressResource = new Address(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - AddressesClient client = new AddressesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertAddressRequest request = new InsertAddressRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - AddressResource = new Address(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - AddressesClient client = new AddressesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.AddressResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertAddressRequest request = new InsertAddressRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - AddressResource = new Address(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - AddressesClient client = new AddressesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.AddressResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.AddressResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/AutoscalersClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/AutoscalersClientTest.g.cs index 93e69948f01a..d1df1c529d76 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/AutoscalersClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/AutoscalersClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedAutoscalersClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteAutoscalerRequest request = new DeleteAutoscalerRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - Autoscaler = "autoscaleradfcda44", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - AutoscalersClient client = new AutoscalersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteAutoscalerRequest request = new DeleteAutoscalerRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - Autoscaler = "autoscaleradfcda44", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - AutoscalersClient client = new AutoscalersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteAutoscalerRequest request = new DeleteAutoscalerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - Autoscaler = "autoscaleradfcda44", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - AutoscalersClient client = new AutoscalersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Zone, request.Autoscaler); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteAutoscalerRequest request = new DeleteAutoscalerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - Autoscaler = "autoscaleradfcda44", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - AutoscalersClient client = new AutoscalersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Zone, request.Autoscaler, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Zone, request.Autoscaler, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetAutoscalerRequest request = new GetAutoscalerRequest { Zone = "zone255f4ea8", @@ -255,6 +75,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetAutoscalerRequest request = new GetAutoscalerRequest { Zone = "zone255f4ea8", @@ -300,6 +121,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetAutoscalerRequest request = new GetAutoscalerRequest { Zone = "zone255f4ea8", @@ -343,6 +165,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetAutoscalerRequest request = new GetAutoscalerRequest { Zone = "zone255f4ea8", @@ -383,555 +206,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertAutoscalerRequest request = new InsertAutoscalerRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - AutoscalersClient client = new AutoscalersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertAutoscalerRequest request = new InsertAutoscalerRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - AutoscalersClient client = new AutoscalersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertAutoscalerRequest request = new InsertAutoscalerRequest - { - Zone = "zone255f4ea8", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - AutoscalersClient client = new AutoscalersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Zone, request.AutoscalerResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertAutoscalerRequest request = new InsertAutoscalerRequest - { - Zone = "zone255f4ea8", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - AutoscalersClient client = new AutoscalersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Zone, request.AutoscalerResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Zone, request.AutoscalerResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchAutoscalerRequest request = new PatchAutoscalerRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - Autoscaler = "autoscaleradfcda44", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - AutoscalersClient client = new AutoscalersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchAutoscalerRequest request = new PatchAutoscalerRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - Autoscaler = "autoscaleradfcda44", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - AutoscalersClient client = new AutoscalersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchAutoscalerRequest request = new PatchAutoscalerRequest - { - Zone = "zone255f4ea8", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - AutoscalersClient client = new AutoscalersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.Zone, request.AutoscalerResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchAutoscalerRequest request = new PatchAutoscalerRequest - { - Zone = "zone255f4ea8", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - AutoscalersClient client = new AutoscalersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.Zone, request.AutoscalerResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.Zone, request.AutoscalerResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void UpdateRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateAutoscalerRequest request = new UpdateAutoscalerRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - Autoscaler = "autoscaleradfcda44", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); - AutoscalersClient client = new AutoscalersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task UpdateRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateAutoscalerRequest request = new UpdateAutoscalerRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - Autoscaler = "autoscaleradfcda44", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - AutoscalersClient client = new AutoscalersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Update() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateAutoscalerRequest request = new UpdateAutoscalerRequest - { - Zone = "zone255f4ea8", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); - AutoscalersClient client = new AutoscalersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request.Project, request.Zone, request.AutoscalerResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task UpdateAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateAutoscalerRequest request = new UpdateAutoscalerRequest - { - Zone = "zone255f4ea8", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - AutoscalersClient client = new AutoscalersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request.Project, request.Zone, request.AutoscalerResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request.Project, request.Zone, request.AutoscalerResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/BackendBucketsClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/BackendBucketsClientTest.g.cs index 54c98293827f..4f367cf038b5 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/BackendBucketsClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/BackendBucketsClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,552 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedBackendBucketsClientTest { - [xunit::FactAttribute] - public void AddSignedUrlKeyRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddSignedUrlKeyBackendBucketRequest request = new AddSignedUrlKeyBackendBucketRequest - { - RequestId = "request_id362c8df6", - BackendBucket = "backend_bucket53dda99e", - Project = "projectaa6ff846", - SignedUrlKeyResource = new SignedUrlKey(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddSignedUrlKey(request, moq::It.IsAny())).Returns(expectedResponse); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddSignedUrlKey(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddSignedUrlKeyRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddSignedUrlKeyBackendBucketRequest request = new AddSignedUrlKeyBackendBucketRequest - { - RequestId = "request_id362c8df6", - BackendBucket = "backend_bucket53dda99e", - Project = "projectaa6ff846", - SignedUrlKeyResource = new SignedUrlKey(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddSignedUrlKeyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddSignedUrlKeyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddSignedUrlKeyAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void AddSignedUrlKey() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddSignedUrlKeyBackendBucketRequest request = new AddSignedUrlKeyBackendBucketRequest - { - BackendBucket = "backend_bucket53dda99e", - Project = "projectaa6ff846", - SignedUrlKeyResource = new SignedUrlKey(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddSignedUrlKey(request, moq::It.IsAny())).Returns(expectedResponse); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddSignedUrlKey(request.Project, request.BackendBucket, request.SignedUrlKeyResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddSignedUrlKeyAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddSignedUrlKeyBackendBucketRequest request = new AddSignedUrlKeyBackendBucketRequest - { - BackendBucket = "backend_bucket53dda99e", - Project = "projectaa6ff846", - SignedUrlKeyResource = new SignedUrlKey(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddSignedUrlKeyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddSignedUrlKeyAsync(request.Project, request.BackendBucket, request.SignedUrlKeyResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddSignedUrlKeyAsync(request.Project, request.BackendBucket, request.SignedUrlKeyResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteBackendBucketRequest request = new DeleteBackendBucketRequest - { - RequestId = "request_id362c8df6", - BackendBucket = "backend_bucket53dda99e", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteBackendBucketRequest request = new DeleteBackendBucketRequest - { - RequestId = "request_id362c8df6", - BackendBucket = "backend_bucket53dda99e", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteBackendBucketRequest request = new DeleteBackendBucketRequest - { - BackendBucket = "backend_bucket53dda99e", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.BackendBucket); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteBackendBucketRequest request = new DeleteBackendBucketRequest - { - BackendBucket = "backend_bucket53dda99e", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.BackendBucket, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.BackendBucket, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteSignedUrlKeyRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSignedUrlKeyBackendBucketRequest request = new DeleteSignedUrlKeyBackendBucketRequest - { - RequestId = "request_id362c8df6", - BackendBucket = "backend_bucket53dda99e", - Project = "projectaa6ff846", - KeyName = "key_namedf8f0795", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteSignedUrlKey(request, moq::It.IsAny())).Returns(expectedResponse); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation response = client.DeleteSignedUrlKey(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteSignedUrlKeyRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSignedUrlKeyBackendBucketRequest request = new DeleteSignedUrlKeyBackendBucketRequest - { - RequestId = "request_id362c8df6", - BackendBucket = "backend_bucket53dda99e", - Project = "projectaa6ff846", - KeyName = "key_namedf8f0795", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteSignedUrlKeyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteSignedUrlKeyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteSignedUrlKeyAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteSignedUrlKey() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSignedUrlKeyBackendBucketRequest request = new DeleteSignedUrlKeyBackendBucketRequest - { - BackendBucket = "backend_bucket53dda99e", - Project = "projectaa6ff846", - KeyName = "key_namedf8f0795", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteSignedUrlKey(request, moq::It.IsAny())).Returns(expectedResponse); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation response = client.DeleteSignedUrlKey(request.Project, request.BackendBucket, request.KeyName); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteSignedUrlKeyAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSignedUrlKeyBackendBucketRequest request = new DeleteSignedUrlKeyBackendBucketRequest - { - BackendBucket = "backend_bucket53dda99e", - Project = "projectaa6ff846", - KeyName = "key_namedf8f0795", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteSignedUrlKeyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteSignedUrlKeyAsync(request.Project, request.BackendBucket, request.KeyName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteSignedUrlKeyAsync(request.Project, request.BackendBucket, request.KeyName, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetBackendBucketRequest request = new GetBackendBucketRequest { BackendBucket = "backend_bucket53dda99e", @@ -604,6 +64,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetBackendBucketRequest request = new GetBackendBucketRequest { BackendBucket = "backend_bucket53dda99e", @@ -638,6 +99,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetBackendBucketRequest request = new GetBackendBucketRequest { BackendBucket = "backend_bucket53dda99e", @@ -670,6 +132,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetBackendBucketRequest request = new GetBackendBucketRequest { BackendBucket = "backend_bucket53dda99e", @@ -699,547 +162,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertBackendBucketRequest request = new InsertBackendBucketRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - BackendBucketResource = new BackendBucket(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertBackendBucketRequest request = new InsertBackendBucketRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - BackendBucketResource = new BackendBucket(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertBackendBucketRequest request = new InsertBackendBucketRequest - { - Project = "projectaa6ff846", - BackendBucketResource = new BackendBucket(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.BackendBucketResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertBackendBucketRequest request = new InsertBackendBucketRequest - { - Project = "projectaa6ff846", - BackendBucketResource = new BackendBucket(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.BackendBucketResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.BackendBucketResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchBackendBucketRequest request = new PatchBackendBucketRequest - { - RequestId = "request_id362c8df6", - BackendBucket = "backend_bucket53dda99e", - Project = "projectaa6ff846", - BackendBucketResource = new BackendBucket(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchBackendBucketRequest request = new PatchBackendBucketRequest - { - RequestId = "request_id362c8df6", - BackendBucket = "backend_bucket53dda99e", - Project = "projectaa6ff846", - BackendBucketResource = new BackendBucket(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchBackendBucketRequest request = new PatchBackendBucketRequest - { - BackendBucket = "backend_bucket53dda99e", - Project = "projectaa6ff846", - BackendBucketResource = new BackendBucket(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.BackendBucket, request.BackendBucketResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchBackendBucketRequest request = new PatchBackendBucketRequest - { - BackendBucket = "backend_bucket53dda99e", - Project = "projectaa6ff846", - BackendBucketResource = new BackendBucket(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.BackendBucket, request.BackendBucketResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.BackendBucket, request.BackendBucketResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void UpdateRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateBackendBucketRequest request = new UpdateBackendBucketRequest - { - RequestId = "request_id362c8df6", - BackendBucket = "backend_bucket53dda99e", - Project = "projectaa6ff846", - BackendBucketResource = new BackendBucket(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task UpdateRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateBackendBucketRequest request = new UpdateBackendBucketRequest - { - RequestId = "request_id362c8df6", - BackendBucket = "backend_bucket53dda99e", - Project = "projectaa6ff846", - BackendBucketResource = new BackendBucket(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Update() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateBackendBucketRequest request = new UpdateBackendBucketRequest - { - BackendBucket = "backend_bucket53dda99e", - Project = "projectaa6ff846", - BackendBucketResource = new BackendBucket(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request.Project, request.BackendBucket, request.BackendBucketResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task UpdateAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateBackendBucketRequest request = new UpdateBackendBucketRequest - { - BackendBucket = "backend_bucket53dda99e", - Project = "projectaa6ff846", - BackendBucketResource = new BackendBucket(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendBucketsClient client = new BackendBucketsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request.Project, request.BackendBucket, request.BackendBucketResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request.Project, request.BackendBucket, request.BackendBucketResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/BackendServicesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/BackendServicesClientTest.g.cs index a94ebd044b93..821ceffb8868 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/BackendServicesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/BackendServicesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -27,1635 +28,377 @@ namespace Google.Cloud.Compute.V1.Tests public sealed class GeneratedBackendServicesClientTest { [xunit::FactAttribute] - public void AddSignedUrlKeyRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddSignedUrlKeyBackendServiceRequest request = new AddSignedUrlKeyBackendServiceRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - SignedUrlKeyResource = new SignedUrlKey(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddSignedUrlKey(request, moq::It.IsAny())).Returns(expectedResponse); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddSignedUrlKey(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddSignedUrlKeyRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddSignedUrlKeyBackendServiceRequest request = new AddSignedUrlKeyBackendServiceRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - SignedUrlKeyResource = new SignedUrlKey(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddSignedUrlKeyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddSignedUrlKeyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddSignedUrlKeyAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void AddSignedUrlKey() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddSignedUrlKeyBackendServiceRequest request = new AddSignedUrlKeyBackendServiceRequest - { - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - SignedUrlKeyResource = new SignedUrlKey(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddSignedUrlKey(request, moq::It.IsAny())).Returns(expectedResponse); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddSignedUrlKey(request.Project, request.BackendService, request.SignedUrlKeyResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddSignedUrlKeyAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddSignedUrlKeyBackendServiceRequest request = new AddSignedUrlKeyBackendServiceRequest - { - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - SignedUrlKeyResource = new SignedUrlKey(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddSignedUrlKeyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddSignedUrlKeyAsync(request.Project, request.BackendService, request.SignedUrlKeyResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddSignedUrlKeyAsync(request.Project, request.BackendService, request.SignedUrlKeyResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteBackendServiceRequest request = new DeleteBackendServiceRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteBackendServiceRequest request = new DeleteBackendServiceRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteBackendServiceRequest request = new DeleteBackendServiceRequest - { - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.BackendService); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteBackendServiceRequest request = new DeleteBackendServiceRequest - { - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.BackendService, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.BackendService, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteSignedUrlKeyRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSignedUrlKeyBackendServiceRequest request = new DeleteSignedUrlKeyBackendServiceRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - KeyName = "key_namedf8f0795", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteSignedUrlKey(request, moq::It.IsAny())).Returns(expectedResponse); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.DeleteSignedUrlKey(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteSignedUrlKeyRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSignedUrlKeyBackendServiceRequest request = new DeleteSignedUrlKeyBackendServiceRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - KeyName = "key_namedf8f0795", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteSignedUrlKeyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteSignedUrlKeyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteSignedUrlKeyAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteSignedUrlKey() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSignedUrlKeyBackendServiceRequest request = new DeleteSignedUrlKeyBackendServiceRequest - { - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - KeyName = "key_namedf8f0795", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteSignedUrlKey(request, moq::It.IsAny())).Returns(expectedResponse); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.DeleteSignedUrlKey(request.Project, request.BackendService, request.KeyName); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteSignedUrlKeyAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSignedUrlKeyBackendServiceRequest request = new DeleteSignedUrlKeyBackendServiceRequest - { - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - KeyName = "key_namedf8f0795", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteSignedUrlKeyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteSignedUrlKeyAsync(request.Project, request.BackendService, request.KeyName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteSignedUrlKeyAsync(request.Project, request.BackendService, request.KeyName, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetBackendServiceRequest request = new GetBackendServiceRequest - { - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - }; - BackendService expectedResponse = new BackendService - { - Id = 11672635353343658936UL, - Iap = new BackendServiceIAP(), - ConsistentHash = new ConsistentHashLoadBalancerSettings(), - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Port = -78310000, - CustomRequestHeaders = - { - "custom_request_headers3532c035", - }, - CreationTimestamp = "creation_timestamp235e59a1", - PortName = "port_namebaaa4cd4", - MaxStreamDuration = new Duration(), - TimeoutSec = -1529270667, - Protocol = BackendService.Types.Protocol.Udp, - FailoverPolicy = new BackendServiceFailoverPolicy(), - LocalityLbPolicy = BackendService.Types.LocalityLbPolicy.UndefinedLocalityLbPolicy, - Region = "regionedb20d96", - SecurityPolicy = "security_policy76596315", - CdnPolicy = new BackendServiceCdnPolicy(), - Network = "networkd22ce091", - Fingerprint = "fingerprint009e6052", - EnableCDN = false, - LogConfig = new BackendServiceLogConfig(), - OutlierDetection = new OutlierDetection(), - LoadBalancingScheme = BackendService.Types.LoadBalancingScheme.UndefinedLoadBalancingScheme, - AffinityCookieTtlSec = -328985636, - CustomResponseHeaders = - { - "custom_response_headersda5d431e", - }, - CircuitBreakers = new CircuitBreakers(), - Description = "description2cf9da67", - HealthChecks = - { - "health_checksedb1f3f8", - }, - SelfLink = "self_link7e87f12d", - ConnectionDraining = new ConnectionDraining(), - SessionAffinity = BackendService.Types.SessionAffinity.GeneratedCookie, - SecuritySettings = new SecuritySettings(), - Backends = { new Backend(), }, - }; - mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - BackendService response = client.Get(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetBackendServiceRequest request = new GetBackendServiceRequest - { - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - }; - BackendService expectedResponse = new BackendService - { - Id = 11672635353343658936UL, - Iap = new BackendServiceIAP(), - ConsistentHash = new ConsistentHashLoadBalancerSettings(), - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Port = -78310000, - CustomRequestHeaders = - { - "custom_request_headers3532c035", - }, - CreationTimestamp = "creation_timestamp235e59a1", - PortName = "port_namebaaa4cd4", - MaxStreamDuration = new Duration(), - TimeoutSec = -1529270667, - Protocol = BackendService.Types.Protocol.Udp, - FailoverPolicy = new BackendServiceFailoverPolicy(), - LocalityLbPolicy = BackendService.Types.LocalityLbPolicy.UndefinedLocalityLbPolicy, - Region = "regionedb20d96", - SecurityPolicy = "security_policy76596315", - CdnPolicy = new BackendServiceCdnPolicy(), - Network = "networkd22ce091", - Fingerprint = "fingerprint009e6052", - EnableCDN = false, - LogConfig = new BackendServiceLogConfig(), - OutlierDetection = new OutlierDetection(), - LoadBalancingScheme = BackendService.Types.LoadBalancingScheme.UndefinedLoadBalancingScheme, - AffinityCookieTtlSec = -328985636, - CustomResponseHeaders = - { - "custom_response_headersda5d431e", - }, - CircuitBreakers = new CircuitBreakers(), - Description = "description2cf9da67", - HealthChecks = - { - "health_checksedb1f3f8", - }, - SelfLink = "self_link7e87f12d", - ConnectionDraining = new ConnectionDraining(), - SessionAffinity = BackendService.Types.SessionAffinity.GeneratedCookie, - SecuritySettings = new SecuritySettings(), - Backends = { new Backend(), }, - }; - mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - BackendService responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - BackendService responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Get() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetBackendServiceRequest request = new GetBackendServiceRequest - { - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - }; - BackendService expectedResponse = new BackendService - { - Id = 11672635353343658936UL, - Iap = new BackendServiceIAP(), - ConsistentHash = new ConsistentHashLoadBalancerSettings(), - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Port = -78310000, - CustomRequestHeaders = - { - "custom_request_headers3532c035", - }, - CreationTimestamp = "creation_timestamp235e59a1", - PortName = "port_namebaaa4cd4", - MaxStreamDuration = new Duration(), - TimeoutSec = -1529270667, - Protocol = BackendService.Types.Protocol.Udp, - FailoverPolicy = new BackendServiceFailoverPolicy(), - LocalityLbPolicy = BackendService.Types.LocalityLbPolicy.UndefinedLocalityLbPolicy, - Region = "regionedb20d96", - SecurityPolicy = "security_policy76596315", - CdnPolicy = new BackendServiceCdnPolicy(), - Network = "networkd22ce091", - Fingerprint = "fingerprint009e6052", - EnableCDN = false, - LogConfig = new BackendServiceLogConfig(), - OutlierDetection = new OutlierDetection(), - LoadBalancingScheme = BackendService.Types.LoadBalancingScheme.UndefinedLoadBalancingScheme, - AffinityCookieTtlSec = -328985636, - CustomResponseHeaders = - { - "custom_response_headersda5d431e", - }, - CircuitBreakers = new CircuitBreakers(), - Description = "description2cf9da67", - HealthChecks = - { - "health_checksedb1f3f8", - }, - SelfLink = "self_link7e87f12d", - ConnectionDraining = new ConnectionDraining(), - SessionAffinity = BackendService.Types.SessionAffinity.GeneratedCookie, - SecuritySettings = new SecuritySettings(), - Backends = { new Backend(), }, - }; - mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - BackendService response = client.Get(request.Project, request.BackendService); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetBackendServiceRequest request = new GetBackendServiceRequest - { - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - }; - BackendService expectedResponse = new BackendService - { - Id = 11672635353343658936UL, - Iap = new BackendServiceIAP(), - ConsistentHash = new ConsistentHashLoadBalancerSettings(), - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Port = -78310000, - CustomRequestHeaders = - { - "custom_request_headers3532c035", - }, - CreationTimestamp = "creation_timestamp235e59a1", - PortName = "port_namebaaa4cd4", - MaxStreamDuration = new Duration(), - TimeoutSec = -1529270667, - Protocol = BackendService.Types.Protocol.Udp, - FailoverPolicy = new BackendServiceFailoverPolicy(), - LocalityLbPolicy = BackendService.Types.LocalityLbPolicy.UndefinedLocalityLbPolicy, - Region = "regionedb20d96", - SecurityPolicy = "security_policy76596315", - CdnPolicy = new BackendServiceCdnPolicy(), - Network = "networkd22ce091", - Fingerprint = "fingerprint009e6052", - EnableCDN = false, - LogConfig = new BackendServiceLogConfig(), - OutlierDetection = new OutlierDetection(), - LoadBalancingScheme = BackendService.Types.LoadBalancingScheme.UndefinedLoadBalancingScheme, - AffinityCookieTtlSec = -328985636, - CustomResponseHeaders = - { - "custom_response_headersda5d431e", - }, - CircuitBreakers = new CircuitBreakers(), - Description = "description2cf9da67", - HealthChecks = - { - "health_checksedb1f3f8", - }, - SelfLink = "self_link7e87f12d", - ConnectionDraining = new ConnectionDraining(), - SessionAffinity = BackendService.Types.SessionAffinity.GeneratedCookie, - SecuritySettings = new SecuritySettings(), - Backends = { new Backend(), }, - }; - mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - BackendService responseCallSettings = await client.GetAsync(request.Project, request.BackendService, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - BackendService responseCancellationToken = await client.GetAsync(request.Project, request.BackendService, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetHealthRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetHealthBackendServiceRequest request = new GetHealthBackendServiceRequest - { - ResourceGroupReferenceResource = new ResourceGroupReference(), - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - }; - BackendServiceGroupHealth expectedResponse = new BackendServiceGroupHealth - { - Kind = "kindf7aa39d9", - Annotations = - { - { - "key8a0b6e3c", - "value60c16320" - }, - }, - HealthStatus = { new HealthStatus(), }, - }; - mockGrpcClient.Setup(x => x.GetHealth(request, moq::It.IsAny())).Returns(expectedResponse); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - BackendServiceGroupHealth response = client.GetHealth(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetHealthRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetHealthBackendServiceRequest request = new GetHealthBackendServiceRequest - { - ResourceGroupReferenceResource = new ResourceGroupReference(), - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - }; - BackendServiceGroupHealth expectedResponse = new BackendServiceGroupHealth - { - Kind = "kindf7aa39d9", - Annotations = - { - { - "key8a0b6e3c", - "value60c16320" - }, - }, - HealthStatus = { new HealthStatus(), }, - }; - mockGrpcClient.Setup(x => x.GetHealthAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - BackendServiceGroupHealth responseCallSettings = await client.GetHealthAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - BackendServiceGroupHealth responseCancellationToken = await client.GetHealthAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetHealth() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetHealthBackendServiceRequest request = new GetHealthBackendServiceRequest - { - ResourceGroupReferenceResource = new ResourceGroupReference(), - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - }; - BackendServiceGroupHealth expectedResponse = new BackendServiceGroupHealth - { - Kind = "kindf7aa39d9", - Annotations = - { - { - "key8a0b6e3c", - "value60c16320" - }, - }, - HealthStatus = { new HealthStatus(), }, - }; - mockGrpcClient.Setup(x => x.GetHealth(request, moq::It.IsAny())).Returns(expectedResponse); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - BackendServiceGroupHealth response = client.GetHealth(request.Project, request.BackendService, request.ResourceGroupReferenceResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetHealthAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetHealthBackendServiceRequest request = new GetHealthBackendServiceRequest - { - ResourceGroupReferenceResource = new ResourceGroupReference(), - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - }; - BackendServiceGroupHealth expectedResponse = new BackendServiceGroupHealth - { - Kind = "kindf7aa39d9", - Annotations = - { - { - "key8a0b6e3c", - "value60c16320" - }, - }, - HealthStatus = { new HealthStatus(), }, - }; - mockGrpcClient.Setup(x => x.GetHealthAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - BackendServiceGroupHealth responseCallSettings = await client.GetHealthAsync(request.Project, request.BackendService, request.ResourceGroupReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - BackendServiceGroupHealth responseCancellationToken = await client.GetHealthAsync(request.Project, request.BackendService, request.ResourceGroupReferenceResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertBackendServiceRequest request = new InsertBackendServiceRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - BackendServiceResource = new BackendService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertBackendServiceRequest request = new InsertBackendServiceRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - BackendServiceResource = new BackendService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertBackendServiceRequest request = new InsertBackendServiceRequest - { - Project = "projectaa6ff846", - BackendServiceResource = new BackendService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.BackendServiceResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertBackendServiceRequest request = new InsertBackendServiceRequest - { - Project = "projectaa6ff846", - BackendServiceResource = new BackendService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.BackendServiceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.BackendServiceResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchBackendServiceRequest request = new PatchBackendServiceRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - BackendServiceResource = new BackendService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchBackendServiceRequest request = new PatchBackendServiceRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - BackendServiceResource = new BackendService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchBackendServiceRequest request = new PatchBackendServiceRequest - { - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - BackendServiceResource = new BackendService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.BackendService, request.BackendServiceResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchBackendServiceRequest request = new PatchBackendServiceRequest - { - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - BackendServiceResource = new BackendService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.BackendService, request.BackendServiceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.BackendService, request.BackendServiceResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetSecurityPolicyRequestObject() + public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSecurityPolicyBackendServiceRequest request = new SetSecurityPolicyBackendServiceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); + GetBackendServiceRequest request = new GetBackendServiceRequest { - RequestId = "request_id362c8df6", - SecurityPolicyReferenceResource = new SecurityPolicyReference(), Project = "projectaa6ff846", BackendService = "backend_serviceed490d45", }; - Operation expectedResponse = new Operation + BackendService expectedResponse = new BackendService { Id = 11672635353343658936UL, + Iap = new BackendServiceIAP(), + ConsistentHash = new ConsistentHashLoadBalancerSettings(), Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", + Port = -78310000, + CustomRequestHeaders = + { + "custom_request_headers3532c035", + }, CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + PortName = "port_namebaaa4cd4", + MaxStreamDuration = new Duration(), + TimeoutSec = -1529270667, + Protocol = BackendService.Types.Protocol.Udp, + FailoverPolicy = new BackendServiceFailoverPolicy(), + LocalityLbPolicy = BackendService.Types.LocalityLbPolicy.UndefinedLocalityLbPolicy, Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + SecurityPolicy = "security_policy76596315", + CdnPolicy = new BackendServiceCdnPolicy(), + Network = "networkd22ce091", + Fingerprint = "fingerprint009e6052", + EnableCDN = false, + LogConfig = new BackendServiceLogConfig(), + OutlierDetection = new OutlierDetection(), + LoadBalancingScheme = BackendService.Types.LoadBalancingScheme.UndefinedLoadBalancingScheme, + AffinityCookieTtlSec = -328985636, + CustomResponseHeaders = + { + "custom_response_headersda5d431e", + }, + CircuitBreakers = new CircuitBreakers(), Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + HealthChecks = + { + "health_checksedb1f3f8", + }, SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + ConnectionDraining = new ConnectionDraining(), + SessionAffinity = BackendService.Types.SessionAffinity.GeneratedCookie, + SecuritySettings = new SecuritySettings(), + Backends = { new Backend(), }, }; - mockGrpcClient.Setup(x => x.SetSecurityPolicy(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetSecurityPolicy(request); + BackendService response = client.Get(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task SetSecurityPolicyRequestObjectAsync() + public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSecurityPolicyBackendServiceRequest request = new SetSecurityPolicyBackendServiceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); + GetBackendServiceRequest request = new GetBackendServiceRequest { - RequestId = "request_id362c8df6", - SecurityPolicyReferenceResource = new SecurityPolicyReference(), Project = "projectaa6ff846", BackendService = "backend_serviceed490d45", }; - Operation expectedResponse = new Operation + BackendService expectedResponse = new BackendService { Id = 11672635353343658936UL, + Iap = new BackendServiceIAP(), + ConsistentHash = new ConsistentHashLoadBalancerSettings(), Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", + Port = -78310000, + CustomRequestHeaders = + { + "custom_request_headers3532c035", + }, CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + PortName = "port_namebaaa4cd4", + MaxStreamDuration = new Duration(), + TimeoutSec = -1529270667, + Protocol = BackendService.Types.Protocol.Udp, + FailoverPolicy = new BackendServiceFailoverPolicy(), + LocalityLbPolicy = BackendService.Types.LocalityLbPolicy.UndefinedLocalityLbPolicy, Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + SecurityPolicy = "security_policy76596315", + CdnPolicy = new BackendServiceCdnPolicy(), + Network = "networkd22ce091", + Fingerprint = "fingerprint009e6052", + EnableCDN = false, + LogConfig = new BackendServiceLogConfig(), + OutlierDetection = new OutlierDetection(), + LoadBalancingScheme = BackendService.Types.LoadBalancingScheme.UndefinedLoadBalancingScheme, + AffinityCookieTtlSec = -328985636, + CustomResponseHeaders = + { + "custom_response_headersda5d431e", + }, + CircuitBreakers = new CircuitBreakers(), Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + HealthChecks = + { + "health_checksedb1f3f8", + }, SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + ConnectionDraining = new ConnectionDraining(), + SessionAffinity = BackendService.Types.SessionAffinity.GeneratedCookie, + SecuritySettings = new SecuritySettings(), + Backends = { new Backend(), }, }; - mockGrpcClient.Setup(x => x.SetSecurityPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetSecurityPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + BackendService responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetSecurityPolicyAsync(request, st::CancellationToken.None); + BackendService responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void SetSecurityPolicy() + public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSecurityPolicyBackendServiceRequest request = new SetSecurityPolicyBackendServiceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); + GetBackendServiceRequest request = new GetBackendServiceRequest { - SecurityPolicyReferenceResource = new SecurityPolicyReference(), Project = "projectaa6ff846", BackendService = "backend_serviceed490d45", }; - Operation expectedResponse = new Operation + BackendService expectedResponse = new BackendService { Id = 11672635353343658936UL, + Iap = new BackendServiceIAP(), + ConsistentHash = new ConsistentHashLoadBalancerSettings(), Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", + Port = -78310000, + CustomRequestHeaders = + { + "custom_request_headers3532c035", + }, CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + PortName = "port_namebaaa4cd4", + MaxStreamDuration = new Duration(), + TimeoutSec = -1529270667, + Protocol = BackendService.Types.Protocol.Udp, + FailoverPolicy = new BackendServiceFailoverPolicy(), + LocalityLbPolicy = BackendService.Types.LocalityLbPolicy.UndefinedLocalityLbPolicy, Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + SecurityPolicy = "security_policy76596315", + CdnPolicy = new BackendServiceCdnPolicy(), + Network = "networkd22ce091", + Fingerprint = "fingerprint009e6052", + EnableCDN = false, + LogConfig = new BackendServiceLogConfig(), + OutlierDetection = new OutlierDetection(), + LoadBalancingScheme = BackendService.Types.LoadBalancingScheme.UndefinedLoadBalancingScheme, + AffinityCookieTtlSec = -328985636, + CustomResponseHeaders = + { + "custom_response_headersda5d431e", + }, + CircuitBreakers = new CircuitBreakers(), Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + HealthChecks = + { + "health_checksedb1f3f8", + }, SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + ConnectionDraining = new ConnectionDraining(), + SessionAffinity = BackendService.Types.SessionAffinity.GeneratedCookie, + SecuritySettings = new SecuritySettings(), + Backends = { new Backend(), }, }; - mockGrpcClient.Setup(x => x.SetSecurityPolicy(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetSecurityPolicy(request.Project, request.BackendService, request.SecurityPolicyReferenceResource); + BackendService response = client.Get(request.Project, request.BackendService); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task SetSecurityPolicyAsync() + public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSecurityPolicyBackendServiceRequest request = new SetSecurityPolicyBackendServiceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); + GetBackendServiceRequest request = new GetBackendServiceRequest { - SecurityPolicyReferenceResource = new SecurityPolicyReference(), Project = "projectaa6ff846", BackendService = "backend_serviceed490d45", }; - Operation expectedResponse = new Operation + BackendService expectedResponse = new BackendService { Id = 11672635353343658936UL, + Iap = new BackendServiceIAP(), + ConsistentHash = new ConsistentHashLoadBalancerSettings(), Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", + Port = -78310000, + CustomRequestHeaders = + { + "custom_request_headers3532c035", + }, CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + PortName = "port_namebaaa4cd4", + MaxStreamDuration = new Duration(), + TimeoutSec = -1529270667, + Protocol = BackendService.Types.Protocol.Udp, + FailoverPolicy = new BackendServiceFailoverPolicy(), + LocalityLbPolicy = BackendService.Types.LocalityLbPolicy.UndefinedLocalityLbPolicy, Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + SecurityPolicy = "security_policy76596315", + CdnPolicy = new BackendServiceCdnPolicy(), + Network = "networkd22ce091", + Fingerprint = "fingerprint009e6052", + EnableCDN = false, + LogConfig = new BackendServiceLogConfig(), + OutlierDetection = new OutlierDetection(), + LoadBalancingScheme = BackendService.Types.LoadBalancingScheme.UndefinedLoadBalancingScheme, + AffinityCookieTtlSec = -328985636, + CustomResponseHeaders = + { + "custom_response_headersda5d431e", + }, + CircuitBreakers = new CircuitBreakers(), Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + HealthChecks = + { + "health_checksedb1f3f8", + }, SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + ConnectionDraining = new ConnectionDraining(), + SessionAffinity = BackendService.Types.SessionAffinity.GeneratedCookie, + SecuritySettings = new SecuritySettings(), + Backends = { new Backend(), }, }; - mockGrpcClient.Setup(x => x.SetSecurityPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetSecurityPolicyAsync(request.Project, request.BackendService, request.SecurityPolicyReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + BackendService responseCallSettings = await client.GetAsync(request.Project, request.BackendService, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetSecurityPolicyAsync(request.Project, request.BackendService, request.SecurityPolicyReferenceResource, st::CancellationToken.None); + BackendService responseCancellationToken = await client.GetAsync(request.Project, request.BackendService, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void UpdateRequestObject() + public void GetHealthRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateBackendServiceRequest request = new UpdateBackendServiceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); + GetHealthBackendServiceRequest request = new GetHealthBackendServiceRequest { - RequestId = "request_id362c8df6", + ResourceGroupReferenceResource = new ResourceGroupReference(), Project = "projectaa6ff846", BackendService = "backend_serviceed490d45", - BackendServiceResource = new BackendService(), }; - Operation expectedResponse = new Operation + BackendServiceGroupHealth expectedResponse = new BackendServiceGroupHealth { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Annotations = + { + { + "key8a0b6e3c", + "value60c16320" + }, + }, + HealthStatus = { new HealthStatus(), }, }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetHealth(request, moq::It.IsAny())).Returns(expectedResponse); BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request); + BackendServiceGroupHealth response = client.GetHealth(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task UpdateRequestObjectAsync() + public async stt::Task GetHealthRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateBackendServiceRequest request = new UpdateBackendServiceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); + GetHealthBackendServiceRequest request = new GetHealthBackendServiceRequest { - RequestId = "request_id362c8df6", + ResourceGroupReferenceResource = new ResourceGroupReference(), Project = "projectaa6ff846", BackendService = "backend_serviceed490d45", - BackendServiceResource = new BackendService(), }; - Operation expectedResponse = new Operation + BackendServiceGroupHealth expectedResponse = new BackendServiceGroupHealth { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Annotations = + { + { + "key8a0b6e3c", + "value60c16320" + }, + }, + HealthStatus = { new HealthStatus(), }, }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetHealthAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + BackendServiceGroupHealth responseCallSettings = await client.GetHealthAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request, st::CancellationToken.None); + BackendServiceGroupHealth responseCancellationToken = await client.GetHealthAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void Update() + public void GetHealth() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateBackendServiceRequest request = new UpdateBackendServiceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); + GetHealthBackendServiceRequest request = new GetHealthBackendServiceRequest { + ResourceGroupReferenceResource = new ResourceGroupReference(), Project = "projectaa6ff846", BackendService = "backend_serviceed490d45", - BackendServiceResource = new BackendService(), }; - Operation expectedResponse = new Operation + BackendServiceGroupHealth expectedResponse = new BackendServiceGroupHealth { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Annotations = + { + { + "key8a0b6e3c", + "value60c16320" + }, + }, + HealthStatus = { new HealthStatus(), }, }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetHealth(request, moq::It.IsAny())).Returns(expectedResponse); BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request.Project, request.BackendService, request.BackendServiceResource); + BackendServiceGroupHealth response = client.GetHealth(request.Project, request.BackendService, request.ResourceGroupReferenceResource); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task UpdateAsync() + public async stt::Task GetHealthAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateBackendServiceRequest request = new UpdateBackendServiceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); + GetHealthBackendServiceRequest request = new GetHealthBackendServiceRequest { + ResourceGroupReferenceResource = new ResourceGroupReference(), Project = "projectaa6ff846", BackendService = "backend_serviceed490d45", - BackendServiceResource = new BackendService(), }; - Operation expectedResponse = new Operation + BackendServiceGroupHealth expectedResponse = new BackendServiceGroupHealth { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Annotations = + { + { + "key8a0b6e3c", + "value60c16320" + }, + }, + HealthStatus = { new HealthStatus(), }, }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetHealthAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); BackendServicesClient client = new BackendServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request.Project, request.BackendService, request.BackendServiceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + BackendServiceGroupHealth responseCallSettings = await client.GetHealthAsync(request.Project, request.BackendService, request.ResourceGroupReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request.Project, request.BackendService, request.BackendServiceResource, st::CancellationToken.None); + BackendServiceGroupHealth responseCancellationToken = await client.GetHealthAsync(request.Project, request.BackendService, request.ResourceGroupReferenceResource, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/DisksClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/DisksClientTest.g.cs index 3972ed2b7aee..860a6a3a893d 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/DisksClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/DisksClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -27,1549 +28,332 @@ namespace Google.Cloud.Compute.V1.Tests public sealed class GeneratedDisksClientTest { [xunit::FactAttribute] - public void AddResourcePoliciesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddResourcePoliciesDiskRequest request = new AddResourcePoliciesDiskRequest - { - Disk = "disk028b6875", - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - DisksAddResourcePoliciesRequestResource = new DisksAddResourcePoliciesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddResourcePolicies(request, moq::It.IsAny())).Returns(expectedResponse); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddResourcePolicies(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddResourcePoliciesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddResourcePoliciesDiskRequest request = new AddResourcePoliciesDiskRequest - { - Disk = "disk028b6875", - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - DisksAddResourcePoliciesRequestResource = new DisksAddResourcePoliciesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddResourcePoliciesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddResourcePoliciesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddResourcePoliciesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void AddResourcePolicies() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddResourcePoliciesDiskRequest request = new AddResourcePoliciesDiskRequest - { - Disk = "disk028b6875", - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - DisksAddResourcePoliciesRequestResource = new DisksAddResourcePoliciesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddResourcePolicies(request, moq::It.IsAny())).Returns(expectedResponse); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddResourcePolicies(request.Project, request.Zone, request.Disk, request.DisksAddResourcePoliciesRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddResourcePoliciesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddResourcePoliciesDiskRequest request = new AddResourcePoliciesDiskRequest - { - Disk = "disk028b6875", - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - DisksAddResourcePoliciesRequestResource = new DisksAddResourcePoliciesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddResourcePoliciesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddResourcePoliciesAsync(request.Project, request.Zone, request.Disk, request.DisksAddResourcePoliciesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddResourcePoliciesAsync(request.Project, request.Zone, request.Disk, request.DisksAddResourcePoliciesRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void CreateSnapshotRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - CreateSnapshotDiskRequest request = new CreateSnapshotDiskRequest - { - Disk = "disk028b6875", - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - GuestFlush = false, - SnapshotResource = new Snapshot(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.CreateSnapshot(request, moq::It.IsAny())).Returns(expectedResponse); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.CreateSnapshot(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task CreateSnapshotRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - CreateSnapshotDiskRequest request = new CreateSnapshotDiskRequest - { - Disk = "disk028b6875", - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - GuestFlush = false, - SnapshotResource = new Snapshot(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.CreateSnapshotAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.CreateSnapshotAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.CreateSnapshotAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void CreateSnapshot() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - CreateSnapshotDiskRequest request = new CreateSnapshotDiskRequest - { - Disk = "disk028b6875", - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - SnapshotResource = new Snapshot(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.CreateSnapshot(request, moq::It.IsAny())).Returns(expectedResponse); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.CreateSnapshot(request.Project, request.Zone, request.Disk, request.SnapshotResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task CreateSnapshotAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - CreateSnapshotDiskRequest request = new CreateSnapshotDiskRequest - { - Disk = "disk028b6875", - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - SnapshotResource = new Snapshot(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.CreateSnapshotAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.CreateSnapshotAsync(request.Project, request.Zone, request.Disk, request.SnapshotResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.CreateSnapshotAsync(request.Project, request.Zone, request.Disk, request.SnapshotResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteDiskRequest request = new DeleteDiskRequest - { - Disk = "disk028b6875", - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteDiskRequest request = new DeleteDiskRequest - { - Disk = "disk028b6875", - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteDiskRequest request = new DeleteDiskRequest - { - Disk = "disk028b6875", - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Zone, request.Disk); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteDiskRequest request = new DeleteDiskRequest - { - Disk = "disk028b6875", - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Zone, request.Disk, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Zone, request.Disk, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetDiskRequest request = new GetDiskRequest - { - Disk = "disk028b6875", - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - }; - Disk expectedResponse = new Disk - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Type = "typee2cc9d59", - Zone = "zone255f4ea8", - ResourcePolicies = - { - "resource_policiesdff15734", - }, - CreationTimestamp = "creation_timestamp235e59a1", - LastAttachTimestamp = "last_attach_timestamp4fe3fe94", - LicenseCodes = - { - -3549522739643304114L, - }, - ReplicaZones = - { - "replica_zonesc1977354", - }, - SourceImage = "source_image5e9c0c38", - SourceImageId = "source_image_id954b5e55", - LastDetachTimestamp = "last_detach_timestampffef196b", - GuestOsFeatures = - { - new GuestOsFeature(), - }, - SourceSnapshotId = "source_snapshot_id008ab5dd", - Users = { "users2a5cc69b", }, - SourceSnapshot = "source_snapshot1fcf3da1", - Region = "regionedb20d96", - LabelFingerprint = "label_fingerprint06ccff3a", - Status = Disk.Types.Status.Deleting, - ProvisionedIops = -3779563869670119518L, - SourceStorageObject = "source_storage_object4e059972", - DiskEncryptionKey = new CustomerEncryptionKey(), - SourceSnapshotEncryptionKey = new CustomerEncryptionKey(), - Licenses = - { - "licensesd1cc2f9d", - }, - LocationHint = "location_hint666f366c", - Options = "optionsa965da93", - SourceImageEncryptionKey = new CustomerEncryptionKey(), - PhysicalBlockSizeBytes = -7292518380745299537L, - Description = "description2cf9da67", - SourceDisk = "source_disk0eec086f", - SourceDiskId = "source_disk_id020f9fb8", - SelfLink = "self_link7e87f12d", - SatisfiesPzs = false, - SizeGb = -3653169847519542788L, - Labels = - { - { - "key8a0b6e3c", - "value60c16320" - }, - }, - }; - mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Disk response = client.Get(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetDiskRequest request = new GetDiskRequest - { - Disk = "disk028b6875", - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - }; - Disk expectedResponse = new Disk - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Type = "typee2cc9d59", - Zone = "zone255f4ea8", - ResourcePolicies = - { - "resource_policiesdff15734", - }, - CreationTimestamp = "creation_timestamp235e59a1", - LastAttachTimestamp = "last_attach_timestamp4fe3fe94", - LicenseCodes = - { - -3549522739643304114L, - }, - ReplicaZones = - { - "replica_zonesc1977354", - }, - SourceImage = "source_image5e9c0c38", - SourceImageId = "source_image_id954b5e55", - LastDetachTimestamp = "last_detach_timestampffef196b", - GuestOsFeatures = - { - new GuestOsFeature(), - }, - SourceSnapshotId = "source_snapshot_id008ab5dd", - Users = { "users2a5cc69b", }, - SourceSnapshot = "source_snapshot1fcf3da1", - Region = "regionedb20d96", - LabelFingerprint = "label_fingerprint06ccff3a", - Status = Disk.Types.Status.Deleting, - ProvisionedIops = -3779563869670119518L, - SourceStorageObject = "source_storage_object4e059972", - DiskEncryptionKey = new CustomerEncryptionKey(), - SourceSnapshotEncryptionKey = new CustomerEncryptionKey(), - Licenses = - { - "licensesd1cc2f9d", - }, - LocationHint = "location_hint666f366c", - Options = "optionsa965da93", - SourceImageEncryptionKey = new CustomerEncryptionKey(), - PhysicalBlockSizeBytes = -7292518380745299537L, - Description = "description2cf9da67", - SourceDisk = "source_disk0eec086f", - SourceDiskId = "source_disk_id020f9fb8", - SelfLink = "self_link7e87f12d", - SatisfiesPzs = false, - SizeGb = -3653169847519542788L, - Labels = - { - { - "key8a0b6e3c", - "value60c16320" - }, - }, - }; - mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Disk responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Disk responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Get() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetDiskRequest request = new GetDiskRequest - { - Disk = "disk028b6875", - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - }; - Disk expectedResponse = new Disk - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Type = "typee2cc9d59", - Zone = "zone255f4ea8", - ResourcePolicies = - { - "resource_policiesdff15734", - }, - CreationTimestamp = "creation_timestamp235e59a1", - LastAttachTimestamp = "last_attach_timestamp4fe3fe94", - LicenseCodes = - { - -3549522739643304114L, - }, - ReplicaZones = - { - "replica_zonesc1977354", - }, - SourceImage = "source_image5e9c0c38", - SourceImageId = "source_image_id954b5e55", - LastDetachTimestamp = "last_detach_timestampffef196b", - GuestOsFeatures = - { - new GuestOsFeature(), - }, - SourceSnapshotId = "source_snapshot_id008ab5dd", - Users = { "users2a5cc69b", }, - SourceSnapshot = "source_snapshot1fcf3da1", - Region = "regionedb20d96", - LabelFingerprint = "label_fingerprint06ccff3a", - Status = Disk.Types.Status.Deleting, - ProvisionedIops = -3779563869670119518L, - SourceStorageObject = "source_storage_object4e059972", - DiskEncryptionKey = new CustomerEncryptionKey(), - SourceSnapshotEncryptionKey = new CustomerEncryptionKey(), - Licenses = - { - "licensesd1cc2f9d", - }, - LocationHint = "location_hint666f366c", - Options = "optionsa965da93", - SourceImageEncryptionKey = new CustomerEncryptionKey(), - PhysicalBlockSizeBytes = -7292518380745299537L, - Description = "description2cf9da67", - SourceDisk = "source_disk0eec086f", - SourceDiskId = "source_disk_id020f9fb8", - SelfLink = "self_link7e87f12d", - SatisfiesPzs = false, - SizeGb = -3653169847519542788L, - Labels = - { - { - "key8a0b6e3c", - "value60c16320" - }, - }, - }; - mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Disk response = client.Get(request.Project, request.Zone, request.Disk); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetDiskRequest request = new GetDiskRequest - { - Disk = "disk028b6875", - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - }; - Disk expectedResponse = new Disk - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Type = "typee2cc9d59", - Zone = "zone255f4ea8", - ResourcePolicies = - { - "resource_policiesdff15734", - }, - CreationTimestamp = "creation_timestamp235e59a1", - LastAttachTimestamp = "last_attach_timestamp4fe3fe94", - LicenseCodes = - { - -3549522739643304114L, - }, - ReplicaZones = - { - "replica_zonesc1977354", - }, - SourceImage = "source_image5e9c0c38", - SourceImageId = "source_image_id954b5e55", - LastDetachTimestamp = "last_detach_timestampffef196b", - GuestOsFeatures = - { - new GuestOsFeature(), - }, - SourceSnapshotId = "source_snapshot_id008ab5dd", - Users = { "users2a5cc69b", }, - SourceSnapshot = "source_snapshot1fcf3da1", - Region = "regionedb20d96", - LabelFingerprint = "label_fingerprint06ccff3a", - Status = Disk.Types.Status.Deleting, - ProvisionedIops = -3779563869670119518L, - SourceStorageObject = "source_storage_object4e059972", - DiskEncryptionKey = new CustomerEncryptionKey(), - SourceSnapshotEncryptionKey = new CustomerEncryptionKey(), - Licenses = - { - "licensesd1cc2f9d", - }, - LocationHint = "location_hint666f366c", - Options = "optionsa965da93", - SourceImageEncryptionKey = new CustomerEncryptionKey(), - PhysicalBlockSizeBytes = -7292518380745299537L, - Description = "description2cf9da67", - SourceDisk = "source_disk0eec086f", - SourceDiskId = "source_disk_id020f9fb8", - SelfLink = "self_link7e87f12d", - SatisfiesPzs = false, - SizeGb = -3653169847519542788L, - Labels = - { - { - "key8a0b6e3c", - "value60c16320" - }, - }, - }; - mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Disk responseCallSettings = await client.GetAsync(request.Project, request.Zone, request.Disk, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Disk responseCancellationToken = await client.GetAsync(request.Project, request.Zone, request.Disk, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetIamPolicyRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetIamPolicyDiskRequest request = new GetIamPolicyDiskRequest - { - Zone = "zone255f4ea8", - Resource = "resource164eab96", - Project = "projectaa6ff846", - OptionsRequestedPolicyVersion = -1471234741, - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.GetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Policy response = client.GetIamPolicy(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetIamPolicyRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetIamPolicyDiskRequest request = new GetIamPolicyDiskRequest - { - Zone = "zone255f4ea8", - Resource = "resource164eab96", - Project = "projectaa6ff846", - OptionsRequestedPolicyVersion = -1471234741, - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.GetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Policy responseCallSettings = await client.GetIamPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Policy responseCancellationToken = await client.GetIamPolicyAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetIamPolicy() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetIamPolicyDiskRequest request = new GetIamPolicyDiskRequest - { - Zone = "zone255f4ea8", - Resource = "resource164eab96", - Project = "projectaa6ff846", - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.GetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Policy response = client.GetIamPolicy(request.Project, request.Zone, request.Resource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetIamPolicyAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetIamPolicyDiskRequest request = new GetIamPolicyDiskRequest - { - Zone = "zone255f4ea8", - Resource = "resource164eab96", - Project = "projectaa6ff846", - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.GetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Policy responseCallSettings = await client.GetIamPolicyAsync(request.Project, request.Zone, request.Resource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Policy responseCancellationToken = await client.GetIamPolicyAsync(request.Project, request.Zone, request.Resource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertDiskRequest request = new InsertDiskRequest - { - Zone = "zone255f4ea8", - DiskResource = new Disk(), - RequestId = "request_id362c8df6", - SourceImage = "source_image5e9c0c38", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertDiskRequest request = new InsertDiskRequest - { - Zone = "zone255f4ea8", - DiskResource = new Disk(), - RequestId = "request_id362c8df6", - SourceImage = "source_image5e9c0c38", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertDiskRequest request = new InsertDiskRequest - { - Zone = "zone255f4ea8", - DiskResource = new Disk(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Zone, request.DiskResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertDiskRequest request = new InsertDiskRequest - { - Zone = "zone255f4ea8", - DiskResource = new Disk(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Zone, request.DiskResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Zone, request.DiskResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void RemoveResourcePoliciesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveResourcePoliciesDiskRequest request = new RemoveResourcePoliciesDiskRequest - { - Disk = "disk028b6875", - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - DisksRemoveResourcePoliciesRequestResource = new DisksRemoveResourcePoliciesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveResourcePolicies(request, moq::It.IsAny())).Returns(expectedResponse); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.RemoveResourcePolicies(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task RemoveResourcePoliciesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveResourcePoliciesDiskRequest request = new RemoveResourcePoliciesDiskRequest - { - Disk = "disk028b6875", - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - DisksRemoveResourcePoliciesRequestResource = new DisksRemoveResourcePoliciesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveResourcePoliciesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RemoveResourcePoliciesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RemoveResourcePoliciesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void RemoveResourcePolicies() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveResourcePoliciesDiskRequest request = new RemoveResourcePoliciesDiskRequest - { - Disk = "disk028b6875", - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - DisksRemoveResourcePoliciesRequestResource = new DisksRemoveResourcePoliciesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveResourcePolicies(request, moq::It.IsAny())).Returns(expectedResponse); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.RemoveResourcePolicies(request.Project, request.Zone, request.Disk, request.DisksRemoveResourcePoliciesRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task RemoveResourcePoliciesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveResourcePoliciesDiskRequest request = new RemoveResourcePoliciesDiskRequest - { - Disk = "disk028b6875", - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - DisksRemoveResourcePoliciesRequestResource = new DisksRemoveResourcePoliciesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveResourcePoliciesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RemoveResourcePoliciesAsync(request.Project, request.Zone, request.Disk, request.DisksRemoveResourcePoliciesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RemoveResourcePoliciesAsync(request.Project, request.Zone, request.Disk, request.DisksRemoveResourcePoliciesRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void ResizeRequestObject() + public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResizeDiskRequest request = new ResizeDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetDiskRequest request = new GetDiskRequest { Disk = "disk028b6875", Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - DisksResizeRequestResource = new DisksResizeRequest(), Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + Disk expectedResponse = new Disk { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", + Type = "typee2cc9d59", Zone = "zone255f4ea8", + ResourcePolicies = + { + "resource_policiesdff15734", + }, CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + LastAttachTimestamp = "last_attach_timestamp4fe3fe94", + LicenseCodes = + { + -3549522739643304114L, + }, + ReplicaZones = + { + "replica_zonesc1977354", + }, + SourceImage = "source_image5e9c0c38", + SourceImageId = "source_image_id954b5e55", + LastDetachTimestamp = "last_detach_timestampffef196b", + GuestOsFeatures = + { + new GuestOsFeature(), + }, + SourceSnapshotId = "source_snapshot_id008ab5dd", + Users = { "users2a5cc69b", }, + SourceSnapshot = "source_snapshot1fcf3da1", Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + LabelFingerprint = "label_fingerprint06ccff3a", + Status = Disk.Types.Status.Deleting, + ProvisionedIops = -3779563869670119518L, + SourceStorageObject = "source_storage_object4e059972", + DiskEncryptionKey = new CustomerEncryptionKey(), + SourceSnapshotEncryptionKey = new CustomerEncryptionKey(), + Licenses = + { + "licensesd1cc2f9d", + }, + LocationHint = "location_hint666f366c", + Options = "optionsa965da93", + SourceImageEncryptionKey = new CustomerEncryptionKey(), + PhysicalBlockSizeBytes = -7292518380745299537L, Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + SourceDisk = "source_disk0eec086f", + SourceDiskId = "source_disk_id020f9fb8", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + SatisfiesPzs = false, + SizeGb = -3653169847519542788L, + Labels = + { + { + "key8a0b6e3c", + "value60c16320" + }, + }, }; - mockGrpcClient.Setup(x => x.Resize(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Resize(request); + Disk response = client.Get(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task ResizeRequestObjectAsync() + public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResizeDiskRequest request = new ResizeDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetDiskRequest request = new GetDiskRequest { Disk = "disk028b6875", Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - DisksResizeRequestResource = new DisksResizeRequest(), Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + Disk expectedResponse = new Disk { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", + Type = "typee2cc9d59", Zone = "zone255f4ea8", + ResourcePolicies = + { + "resource_policiesdff15734", + }, CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + LastAttachTimestamp = "last_attach_timestamp4fe3fe94", + LicenseCodes = + { + -3549522739643304114L, + }, + ReplicaZones = + { + "replica_zonesc1977354", + }, + SourceImage = "source_image5e9c0c38", + SourceImageId = "source_image_id954b5e55", + LastDetachTimestamp = "last_detach_timestampffef196b", + GuestOsFeatures = + { + new GuestOsFeature(), + }, + SourceSnapshotId = "source_snapshot_id008ab5dd", + Users = { "users2a5cc69b", }, + SourceSnapshot = "source_snapshot1fcf3da1", Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + LabelFingerprint = "label_fingerprint06ccff3a", + Status = Disk.Types.Status.Deleting, + ProvisionedIops = -3779563869670119518L, + SourceStorageObject = "source_storage_object4e059972", + DiskEncryptionKey = new CustomerEncryptionKey(), + SourceSnapshotEncryptionKey = new CustomerEncryptionKey(), + Licenses = + { + "licensesd1cc2f9d", + }, + LocationHint = "location_hint666f366c", + Options = "optionsa965da93", + SourceImageEncryptionKey = new CustomerEncryptionKey(), + PhysicalBlockSizeBytes = -7292518380745299537L, Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + SourceDisk = "source_disk0eec086f", + SourceDiskId = "source_disk_id020f9fb8", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + SatisfiesPzs = false, + SizeGb = -3653169847519542788L, + Labels = + { + { + "key8a0b6e3c", + "value60c16320" + }, + }, }; - mockGrpcClient.Setup(x => x.ResizeAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.ResizeAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Disk responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.ResizeAsync(request, st::CancellationToken.None); + Disk responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void Resize() + public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResizeDiskRequest request = new ResizeDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetDiskRequest request = new GetDiskRequest { Disk = "disk028b6875", Zone = "zone255f4ea8", - DisksResizeRequestResource = new DisksResizeRequest(), Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + Disk expectedResponse = new Disk { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", + Type = "typee2cc9d59", Zone = "zone255f4ea8", + ResourcePolicies = + { + "resource_policiesdff15734", + }, CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + LastAttachTimestamp = "last_attach_timestamp4fe3fe94", + LicenseCodes = + { + -3549522739643304114L, + }, + ReplicaZones = + { + "replica_zonesc1977354", + }, + SourceImage = "source_image5e9c0c38", + SourceImageId = "source_image_id954b5e55", + LastDetachTimestamp = "last_detach_timestampffef196b", + GuestOsFeatures = + { + new GuestOsFeature(), + }, + SourceSnapshotId = "source_snapshot_id008ab5dd", + Users = { "users2a5cc69b", }, + SourceSnapshot = "source_snapshot1fcf3da1", Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + LabelFingerprint = "label_fingerprint06ccff3a", + Status = Disk.Types.Status.Deleting, + ProvisionedIops = -3779563869670119518L, + SourceStorageObject = "source_storage_object4e059972", + DiskEncryptionKey = new CustomerEncryptionKey(), + SourceSnapshotEncryptionKey = new CustomerEncryptionKey(), + Licenses = + { + "licensesd1cc2f9d", + }, + LocationHint = "location_hint666f366c", + Options = "optionsa965da93", + SourceImageEncryptionKey = new CustomerEncryptionKey(), + PhysicalBlockSizeBytes = -7292518380745299537L, Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + SourceDisk = "source_disk0eec086f", + SourceDiskId = "source_disk_id020f9fb8", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + SatisfiesPzs = false, + SizeGb = -3653169847519542788L, + Labels = + { + { + "key8a0b6e3c", + "value60c16320" + }, + }, }; - mockGrpcClient.Setup(x => x.Resize(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Resize(request.Project, request.Zone, request.Disk, request.DisksResizeRequestResource); + Disk response = client.Get(request.Project, request.Zone, request.Disk); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task ResizeAsync() + public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResizeDiskRequest request = new ResizeDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetDiskRequest request = new GetDiskRequest { Disk = "disk028b6875", Zone = "zone255f4ea8", - DisksResizeRequestResource = new DisksResizeRequest(), Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + Disk expectedResponse = new Disk { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", + Type = "typee2cc9d59", Zone = "zone255f4ea8", + ResourcePolicies = + { + "resource_policiesdff15734", + }, CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + LastAttachTimestamp = "last_attach_timestamp4fe3fe94", + LicenseCodes = + { + -3549522739643304114L, + }, + ReplicaZones = + { + "replica_zonesc1977354", + }, + SourceImage = "source_image5e9c0c38", + SourceImageId = "source_image_id954b5e55", + LastDetachTimestamp = "last_detach_timestampffef196b", + GuestOsFeatures = + { + new GuestOsFeature(), + }, + SourceSnapshotId = "source_snapshot_id008ab5dd", + Users = { "users2a5cc69b", }, + SourceSnapshot = "source_snapshot1fcf3da1", Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + LabelFingerprint = "label_fingerprint06ccff3a", + Status = Disk.Types.Status.Deleting, + ProvisionedIops = -3779563869670119518L, + SourceStorageObject = "source_storage_object4e059972", + DiskEncryptionKey = new CustomerEncryptionKey(), + SourceSnapshotEncryptionKey = new CustomerEncryptionKey(), + Licenses = + { + "licensesd1cc2f9d", + }, + LocationHint = "location_hint666f366c", + Options = "optionsa965da93", + SourceImageEncryptionKey = new CustomerEncryptionKey(), + PhysicalBlockSizeBytes = -7292518380745299537L, Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + SourceDisk = "source_disk0eec086f", + SourceDiskId = "source_disk_id020f9fb8", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + SatisfiesPzs = false, + SizeGb = -3653169847519542788L, + Labels = + { + { + "key8a0b6e3c", + "value60c16320" + }, + }, }; - mockGrpcClient.Setup(x => x.ResizeAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.ResizeAsync(request.Project, request.Zone, request.Disk, request.DisksResizeRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Disk responseCallSettings = await client.GetAsync(request.Project, request.Zone, request.Disk, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.ResizeAsync(request.Project, request.Zone, request.Disk, request.DisksResizeRequestResource, st::CancellationToken.None); + Disk responseCancellationToken = await client.GetAsync(request.Project, request.Zone, request.Disk, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void SetIamPolicyRequestObject() + public void GetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetIamPolicyDiskRequest request = new SetIamPolicyDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetIamPolicyDiskRequest request = new GetIamPolicyDiskRequest { Zone = "zone255f4ea8", Resource = "resource164eab96", Project = "projectaa6ff846", - ZoneSetPolicyRequestResource = new ZoneSetPolicyRequest(), + OptionsRequestedPolicyVersion = -1471234741, }; Policy expectedResponse = new Policy { @@ -1580,23 +364,24 @@ public void SetIamPolicyRequestObject() Bindings = { new Binding(), }, IamOwned = false, }; - mockGrpcClient.Setup(x => x.SetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Policy response = client.SetIamPolicy(request); + Policy response = client.GetIamPolicy(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task SetIamPolicyRequestObjectAsync() + public async stt::Task GetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetIamPolicyDiskRequest request = new SetIamPolicyDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetIamPolicyDiskRequest request = new GetIamPolicyDiskRequest { Zone = "zone255f4ea8", Resource = "resource164eab96", Project = "projectaa6ff846", - ZoneSetPolicyRequestResource = new ZoneSetPolicyRequest(), + OptionsRequestedPolicyVersion = -1471234741, }; Policy expectedResponse = new Policy { @@ -1607,25 +392,25 @@ public void SetIamPolicyRequestObject() Bindings = { new Binding(), }, IamOwned = false, }; - mockGrpcClient.Setup(x => x.SetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Policy responseCallSettings = await client.SetIamPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Policy responseCallSettings = await client.GetIamPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Policy responseCancellationToken = await client.SetIamPolicyAsync(request, st::CancellationToken.None); + Policy responseCancellationToken = await client.GetIamPolicyAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void SetIamPolicy() + public void GetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetIamPolicyDiskRequest request = new SetIamPolicyDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetIamPolicyDiskRequest request = new GetIamPolicyDiskRequest { Zone = "zone255f4ea8", Resource = "resource164eab96", Project = "projectaa6ff846", - ZoneSetPolicyRequestResource = new ZoneSetPolicyRequest(), }; Policy expectedResponse = new Policy { @@ -1636,23 +421,23 @@ public void SetIamPolicy() Bindings = { new Binding(), }, IamOwned = false, }; - mockGrpcClient.Setup(x => x.SetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Policy response = client.SetIamPolicy(request.Project, request.Zone, request.Resource, request.ZoneSetPolicyRequestResource); + Policy response = client.GetIamPolicy(request.Project, request.Zone, request.Resource); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task SetIamPolicyAsync() + public async stt::Task GetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetIamPolicyDiskRequest request = new SetIamPolicyDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetIamPolicyDiskRequest request = new GetIamPolicyDiskRequest { Zone = "zone255f4ea8", Resource = "resource164eab96", Project = "projectaa6ff846", - ZoneSetPolicyRequestResource = new ZoneSetPolicyRequest(), }; Policy expectedResponse = new Policy { @@ -1663,197 +448,127 @@ public void SetIamPolicy() Bindings = { new Binding(), }, IamOwned = false, }; - mockGrpcClient.Setup(x => x.SetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Policy responseCallSettings = await client.SetIamPolicyAsync(request.Project, request.Zone, request.Resource, request.ZoneSetPolicyRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Policy responseCallSettings = await client.GetIamPolicyAsync(request.Project, request.Zone, request.Resource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Policy responseCancellationToken = await client.SetIamPolicyAsync(request.Project, request.Zone, request.Resource, request.ZoneSetPolicyRequestResource, st::CancellationToken.None); + Policy responseCancellationToken = await client.GetIamPolicyAsync(request.Project, request.Zone, request.Resource, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void SetLabelsRequestObject() + public void SetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsDiskRequest request = new SetLabelsDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + SetIamPolicyDiskRequest request = new SetIamPolicyDiskRequest { Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", Resource = "resource164eab96", Project = "projectaa6ff846", - ZoneSetLabelsRequestResource = new ZoneSetLabelsRequest(), + ZoneSetPolicyRequestResource = new ZoneSetPolicyRequest(), }; - Operation expectedResponse = new Operation + Policy expectedResponse = new Policy { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.SetLabels(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.SetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetLabels(request); + Policy response = client.SetIamPolicy(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task SetLabelsRequestObjectAsync() + public async stt::Task SetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsDiskRequest request = new SetLabelsDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + SetIamPolicyDiskRequest request = new SetIamPolicyDiskRequest { Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", Resource = "resource164eab96", Project = "projectaa6ff846", - ZoneSetLabelsRequestResource = new ZoneSetLabelsRequest(), + ZoneSetPolicyRequestResource = new ZoneSetPolicyRequest(), }; - Operation expectedResponse = new Operation + Policy expectedResponse = new Policy { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.SetLabelsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.SetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetLabelsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Policy responseCallSettings = await client.SetIamPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetLabelsAsync(request, st::CancellationToken.None); + Policy responseCancellationToken = await client.SetIamPolicyAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void SetLabels() + public void SetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsDiskRequest request = new SetLabelsDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + SetIamPolicyDiskRequest request = new SetIamPolicyDiskRequest { Zone = "zone255f4ea8", Resource = "resource164eab96", Project = "projectaa6ff846", - ZoneSetLabelsRequestResource = new ZoneSetLabelsRequest(), + ZoneSetPolicyRequestResource = new ZoneSetPolicyRequest(), }; - Operation expectedResponse = new Operation + Policy expectedResponse = new Policy { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.SetLabels(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.SetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetLabels(request.Project, request.Zone, request.Resource, request.ZoneSetLabelsRequestResource); + Policy response = client.SetIamPolicy(request.Project, request.Zone, request.Resource, request.ZoneSetPolicyRequestResource); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task SetLabelsAsync() + public async stt::Task SetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsDiskRequest request = new SetLabelsDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + SetIamPolicyDiskRequest request = new SetIamPolicyDiskRequest { Zone = "zone255f4ea8", Resource = "resource164eab96", Project = "projectaa6ff846", - ZoneSetLabelsRequestResource = new ZoneSetLabelsRequest(), + ZoneSetPolicyRequestResource = new ZoneSetPolicyRequest(), }; - Operation expectedResponse = new Operation + Policy expectedResponse = new Policy { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.SetLabelsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.SetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); DisksClient client = new DisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetLabelsAsync(request.Project, request.Zone, request.Resource, request.ZoneSetLabelsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Policy responseCallSettings = await client.SetIamPolicyAsync(request.Project, request.Zone, request.Resource, request.ZoneSetPolicyRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetLabelsAsync(request.Project, request.Zone, request.Resource, request.ZoneSetLabelsRequestResource, st::CancellationToken.None); + Policy responseCancellationToken = await client.SetIamPolicyAsync(request.Project, request.Zone, request.Resource, request.ZoneSetPolicyRequestResource, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } @@ -1862,6 +577,7 @@ public void SetLabels() public void TestIamPermissionsRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); TestIamPermissionsDiskRequest request = new TestIamPermissionsDiskRequest { Zone = "zone255f4ea8", @@ -1887,6 +603,7 @@ public void TestIamPermissionsRequestObject() public async stt::Task TestIamPermissionsRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); TestIamPermissionsDiskRequest request = new TestIamPermissionsDiskRequest { Zone = "zone255f4ea8", @@ -1914,6 +631,7 @@ public void TestIamPermissionsRequestObject() public void TestIamPermissions() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); TestIamPermissionsDiskRequest request = new TestIamPermissionsDiskRequest { Zone = "zone255f4ea8", @@ -1939,6 +657,7 @@ public void TestIamPermissions() public async stt::Task TestIamPermissionsAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); TestIamPermissionsDiskRequest request = new TestIamPermissionsDiskRequest { Zone = "zone255f4ea8", diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ExternalVpnGatewaysClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ExternalVpnGatewaysClientTest.g.cs index bcc040b565a9..392ff09d2cde 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ExternalVpnGatewaysClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ExternalVpnGatewaysClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,188 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedExternalVpnGatewaysClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteExternalVpnGatewayRequest request = new DeleteExternalVpnGatewayRequest - { - RequestId = "request_id362c8df6", - ExternalVpnGateway = "external_vpn_gatewaycc117eb0", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - ExternalVpnGatewaysClient client = new ExternalVpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteExternalVpnGatewayRequest request = new DeleteExternalVpnGatewayRequest - { - RequestId = "request_id362c8df6", - ExternalVpnGateway = "external_vpn_gatewaycc117eb0", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ExternalVpnGatewaysClient client = new ExternalVpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteExternalVpnGatewayRequest request = new DeleteExternalVpnGatewayRequest - { - ExternalVpnGateway = "external_vpn_gatewaycc117eb0", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - ExternalVpnGatewaysClient client = new ExternalVpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.ExternalVpnGateway); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteExternalVpnGatewayRequest request = new DeleteExternalVpnGatewayRequest - { - ExternalVpnGateway = "external_vpn_gatewaycc117eb0", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ExternalVpnGatewaysClient client = new ExternalVpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.ExternalVpnGateway, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.ExternalVpnGateway, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetExternalVpnGatewayRequest request = new GetExternalVpnGatewayRequest { ExternalVpnGateway = "external_vpn_gatewaycc117eb0", @@ -246,6 +70,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetExternalVpnGatewayRequest request = new GetExternalVpnGatewayRequest { ExternalVpnGateway = "external_vpn_gatewaycc117eb0", @@ -286,6 +111,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetExternalVpnGatewayRequest request = new GetExternalVpnGatewayRequest { ExternalVpnGateway = "external_vpn_gatewaycc117eb0", @@ -324,6 +150,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetExternalVpnGatewayRequest request = new GetExternalVpnGatewayRequest { ExternalVpnGateway = "external_vpn_gatewaycc117eb0", @@ -360,368 +187,11 @@ public void Get() mockGrpcClient.VerifyAll(); } - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertExternalVpnGatewayRequest request = new InsertExternalVpnGatewayRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - ExternalVpnGatewayResource = new ExternalVpnGateway(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - ExternalVpnGatewaysClient client = new ExternalVpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertExternalVpnGatewayRequest request = new InsertExternalVpnGatewayRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - ExternalVpnGatewayResource = new ExternalVpnGateway(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ExternalVpnGatewaysClient client = new ExternalVpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertExternalVpnGatewayRequest request = new InsertExternalVpnGatewayRequest - { - Project = "projectaa6ff846", - ExternalVpnGatewayResource = new ExternalVpnGateway(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - ExternalVpnGatewaysClient client = new ExternalVpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.ExternalVpnGatewayResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertExternalVpnGatewayRequest request = new InsertExternalVpnGatewayRequest - { - Project = "projectaa6ff846", - ExternalVpnGatewayResource = new ExternalVpnGateway(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ExternalVpnGatewaysClient client = new ExternalVpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.ExternalVpnGatewayResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.ExternalVpnGatewayResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetLabelsRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsExternalVpnGatewayRequest request = new SetLabelsExternalVpnGatewayRequest - { - Resource = "resource164eab96", - Project = "projectaa6ff846", - GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabels(request, moq::It.IsAny())).Returns(expectedResponse); - ExternalVpnGatewaysClient client = new ExternalVpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetLabels(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetLabelsRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsExternalVpnGatewayRequest request = new SetLabelsExternalVpnGatewayRequest - { - Resource = "resource164eab96", - Project = "projectaa6ff846", - GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabelsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ExternalVpnGatewaysClient client = new ExternalVpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetLabelsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetLabelsAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetLabels() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsExternalVpnGatewayRequest request = new SetLabelsExternalVpnGatewayRequest - { - Resource = "resource164eab96", - Project = "projectaa6ff846", - GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabels(request, moq::It.IsAny())).Returns(expectedResponse); - ExternalVpnGatewaysClient client = new ExternalVpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetLabels(request.Project, request.Resource, request.GlobalSetLabelsRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetLabelsAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsExternalVpnGatewayRequest request = new SetLabelsExternalVpnGatewayRequest - { - Resource = "resource164eab96", - Project = "projectaa6ff846", - GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabelsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ExternalVpnGatewaysClient client = new ExternalVpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetLabelsAsync(request.Project, request.Resource, request.GlobalSetLabelsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetLabelsAsync(request.Project, request.Resource, request.GlobalSetLabelsRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void TestIamPermissionsRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); TestIamPermissionsExternalVpnGatewayRequest request = new TestIamPermissionsExternalVpnGatewayRequest { Resource = "resource164eab96", @@ -746,6 +216,7 @@ public void TestIamPermissionsRequestObject() public async stt::Task TestIamPermissionsRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); TestIamPermissionsExternalVpnGatewayRequest request = new TestIamPermissionsExternalVpnGatewayRequest { Resource = "resource164eab96", @@ -772,6 +243,7 @@ public void TestIamPermissionsRequestObject() public void TestIamPermissions() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); TestIamPermissionsExternalVpnGatewayRequest request = new TestIamPermissionsExternalVpnGatewayRequest { Resource = "resource164eab96", @@ -796,6 +268,7 @@ public void TestIamPermissions() public async stt::Task TestIamPermissionsAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); TestIamPermissionsExternalVpnGatewayRequest request = new TestIamPermissionsExternalVpnGatewayRequest { Resource = "resource164eab96", diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/FirewallPoliciesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/FirewallPoliciesClientTest.g.cs index 5f21c6ced65b..41ebc7fd38cc 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/FirewallPoliciesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/FirewallPoliciesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -27,2363 +28,613 @@ namespace Google.Cloud.Compute.V1.Tests public sealed class GeneratedFirewallPoliciesClientTest { [xunit::FactAttribute] - public void AddAssociationRequestObject() + public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddAssociationFirewallPolicyRequest request = new AddAssociationFirewallPolicyRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); + GetFirewallPolicyRequest request = new GetFirewallPolicyRequest { - RequestId = "request_id362c8df6", - ReplaceExistingAssociation = true, - FirewallPolicyAssociationResource = new FirewallPolicyAssociation(), FirewallPolicy = "firewall_policy1f9c9144", }; - Operation expectedResponse = new Operation + FirewallPolicy expectedResponse = new FirewallPolicy { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", + DisplayName = "display_name137f65c2", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + SelfLinkWithId = "self_link_with_id6d1e3896", + Parent = "parent7858e4d0", + Rules = + { + new FirewallPolicyRule(), + }, + Fingerprint = "fingerprint009e6052", + RuleTupleCount = -1393850828, Description = "description2cf9da67", - InsertTime = "insert_time7467185a", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + ShortName = "short_namec7ba9846", + Associations = + { + new FirewallPolicyAssociation(), + }, }; - mockGrpcClient.Setup(x => x.AddAssociation(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddAssociation(request); + FirewallPolicy response = client.Get(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task AddAssociationRequestObjectAsync() + public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddAssociationFirewallPolicyRequest request = new AddAssociationFirewallPolicyRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); + GetFirewallPolicyRequest request = new GetFirewallPolicyRequest { - RequestId = "request_id362c8df6", - ReplaceExistingAssociation = true, - FirewallPolicyAssociationResource = new FirewallPolicyAssociation(), FirewallPolicy = "firewall_policy1f9c9144", }; - Operation expectedResponse = new Operation + FirewallPolicy expectedResponse = new FirewallPolicy { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", + DisplayName = "display_name137f65c2", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + SelfLinkWithId = "self_link_with_id6d1e3896", + Parent = "parent7858e4d0", + Rules = + { + new FirewallPolicyRule(), + }, + Fingerprint = "fingerprint009e6052", + RuleTupleCount = -1393850828, Description = "description2cf9da67", - InsertTime = "insert_time7467185a", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + ShortName = "short_namec7ba9846", + Associations = + { + new FirewallPolicyAssociation(), + }, }; - mockGrpcClient.Setup(x => x.AddAssociationAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddAssociationAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + FirewallPolicy responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddAssociationAsync(request, st::CancellationToken.None); + FirewallPolicy responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void AddAssociation() + public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddAssociationFirewallPolicyRequest request = new AddAssociationFirewallPolicyRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); + GetFirewallPolicyRequest request = new GetFirewallPolicyRequest { - FirewallPolicyAssociationResource = new FirewallPolicyAssociation(), FirewallPolicy = "firewall_policy1f9c9144", }; - Operation expectedResponse = new Operation + FirewallPolicy expectedResponse = new FirewallPolicy { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", + DisplayName = "display_name137f65c2", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + SelfLinkWithId = "self_link_with_id6d1e3896", + Parent = "parent7858e4d0", + Rules = + { + new FirewallPolicyRule(), + }, + Fingerprint = "fingerprint009e6052", + RuleTupleCount = -1393850828, Description = "description2cf9da67", - InsertTime = "insert_time7467185a", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + ShortName = "short_namec7ba9846", + Associations = + { + new FirewallPolicyAssociation(), + }, }; - mockGrpcClient.Setup(x => x.AddAssociation(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddAssociation(request.FirewallPolicy, request.FirewallPolicyAssociationResource); + FirewallPolicy response = client.Get(request.FirewallPolicy); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task AddAssociationAsync() + public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddAssociationFirewallPolicyRequest request = new AddAssociationFirewallPolicyRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); + GetFirewallPolicyRequest request = new GetFirewallPolicyRequest { - FirewallPolicyAssociationResource = new FirewallPolicyAssociation(), FirewallPolicy = "firewall_policy1f9c9144", }; - Operation expectedResponse = new Operation + FirewallPolicy expectedResponse = new FirewallPolicy { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", + DisplayName = "display_name137f65c2", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + SelfLinkWithId = "self_link_with_id6d1e3896", + Parent = "parent7858e4d0", + Rules = + { + new FirewallPolicyRule(), + }, + Fingerprint = "fingerprint009e6052", + RuleTupleCount = -1393850828, Description = "description2cf9da67", - InsertTime = "insert_time7467185a", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + ShortName = "short_namec7ba9846", + Associations = + { + new FirewallPolicyAssociation(), + }, }; - mockGrpcClient.Setup(x => x.AddAssociationAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddAssociationAsync(request.FirewallPolicy, request.FirewallPolicyAssociationResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + FirewallPolicy responseCallSettings = await client.GetAsync(request.FirewallPolicy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddAssociationAsync(request.FirewallPolicy, request.FirewallPolicyAssociationResource, st::CancellationToken.None); + FirewallPolicy responseCancellationToken = await client.GetAsync(request.FirewallPolicy, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void AddRuleRequestObject() + public void GetAssociationRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddRuleFirewallPolicyRequest request = new AddRuleFirewallPolicyRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); + GetAssociationFirewallPolicyRequest request = new GetAssociationFirewallPolicyRequest { - RequestId = "request_id362c8df6", - FirewallPolicyRuleResource = new FirewallPolicyRule(), + Name = "name1c9368b0", FirewallPolicy = "firewall_policy1f9c9144", }; - Operation expectedResponse = new Operation + FirewallPolicyAssociation expectedResponse = new FirewallPolicyAssociation { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + DisplayName = "display_name137f65c2", + AttachmentTarget = "attachment_targetf83a4ab8", + FirewallPolicyId = "firewall_policy_id306dc2cb", + ShortName = "short_namec7ba9846", }; - mockGrpcClient.Setup(x => x.AddRule(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetAssociation(request, moq::It.IsAny())).Returns(expectedResponse); FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddRule(request); + FirewallPolicyAssociation response = client.GetAssociation(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task AddRuleRequestObjectAsync() + public async stt::Task GetAssociationRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddRuleFirewallPolicyRequest request = new AddRuleFirewallPolicyRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); + GetAssociationFirewallPolicyRequest request = new GetAssociationFirewallPolicyRequest { - RequestId = "request_id362c8df6", - FirewallPolicyRuleResource = new FirewallPolicyRule(), + Name = "name1c9368b0", FirewallPolicy = "firewall_policy1f9c9144", }; - Operation expectedResponse = new Operation + FirewallPolicyAssociation expectedResponse = new FirewallPolicyAssociation { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + DisplayName = "display_name137f65c2", + AttachmentTarget = "attachment_targetf83a4ab8", + FirewallPolicyId = "firewall_policy_id306dc2cb", + ShortName = "short_namec7ba9846", }; - mockGrpcClient.Setup(x => x.AddRuleAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetAssociationAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddRuleAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + FirewallPolicyAssociation responseCallSettings = await client.GetAssociationAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddRuleAsync(request, st::CancellationToken.None); + FirewallPolicyAssociation responseCancellationToken = await client.GetAssociationAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void AddRule() + public void GetAssociation() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddRuleFirewallPolicyRequest request = new AddRuleFirewallPolicyRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); + GetAssociationFirewallPolicyRequest request = new GetAssociationFirewallPolicyRequest { - FirewallPolicyRuleResource = new FirewallPolicyRule(), FirewallPolicy = "firewall_policy1f9c9144", }; - Operation expectedResponse = new Operation + FirewallPolicyAssociation expectedResponse = new FirewallPolicyAssociation { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + DisplayName = "display_name137f65c2", + AttachmentTarget = "attachment_targetf83a4ab8", + FirewallPolicyId = "firewall_policy_id306dc2cb", + ShortName = "short_namec7ba9846", }; - mockGrpcClient.Setup(x => x.AddRule(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetAssociation(request, moq::It.IsAny())).Returns(expectedResponse); FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddRule(request.FirewallPolicy, request.FirewallPolicyRuleResource); + FirewallPolicyAssociation response = client.GetAssociation(request.FirewallPolicy); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task AddRuleAsync() + public async stt::Task GetAssociationAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddRuleFirewallPolicyRequest request = new AddRuleFirewallPolicyRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); + GetAssociationFirewallPolicyRequest request = new GetAssociationFirewallPolicyRequest { - FirewallPolicyRuleResource = new FirewallPolicyRule(), FirewallPolicy = "firewall_policy1f9c9144", }; - Operation expectedResponse = new Operation + FirewallPolicyAssociation expectedResponse = new FirewallPolicyAssociation { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + DisplayName = "display_name137f65c2", + AttachmentTarget = "attachment_targetf83a4ab8", + FirewallPolicyId = "firewall_policy_id306dc2cb", + ShortName = "short_namec7ba9846", }; - mockGrpcClient.Setup(x => x.AddRuleAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetAssociationAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddRuleAsync(request.FirewallPolicy, request.FirewallPolicyRuleResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + FirewallPolicyAssociation responseCallSettings = await client.GetAssociationAsync(request.FirewallPolicy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddRuleAsync(request.FirewallPolicy, request.FirewallPolicyRuleResource, st::CancellationToken.None); + FirewallPolicyAssociation responseCancellationToken = await client.GetAssociationAsync(request.FirewallPolicy, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void CloneRulesRequestObject() + public void GetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - CloneRulesFirewallPolicyRequest request = new CloneRulesFirewallPolicyRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); + GetIamPolicyFirewallPolicyRequest request = new GetIamPolicyFirewallPolicyRequest { - SourceFirewallPolicy = "source_firewall_policy9e4c1490", - RequestId = "request_id362c8df6", - FirewallPolicy = "firewall_policy1f9c9144", + Resource = "resource164eab96", + OptionsRequestedPolicyVersion = -1471234741, }; - Operation expectedResponse = new Operation + Policy expectedResponse = new Policy { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.CloneRules(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.CloneRules(request); + Policy response = client.GetIamPolicy(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task CloneRulesRequestObjectAsync() + public async stt::Task GetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - CloneRulesFirewallPolicyRequest request = new CloneRulesFirewallPolicyRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); + GetIamPolicyFirewallPolicyRequest request = new GetIamPolicyFirewallPolicyRequest { - SourceFirewallPolicy = "source_firewall_policy9e4c1490", - RequestId = "request_id362c8df6", - FirewallPolicy = "firewall_policy1f9c9144", + Resource = "resource164eab96", + OptionsRequestedPolicyVersion = -1471234741, }; - Operation expectedResponse = new Operation + Policy expectedResponse = new Policy { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.CloneRulesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.CloneRulesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Policy responseCallSettings = await client.GetIamPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.CloneRulesAsync(request, st::CancellationToken.None); + Policy responseCancellationToken = await client.GetIamPolicyAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void CloneRules() + public void GetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - CloneRulesFirewallPolicyRequest request = new CloneRulesFirewallPolicyRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); + GetIamPolicyFirewallPolicyRequest request = new GetIamPolicyFirewallPolicyRequest { - FirewallPolicy = "firewall_policy1f9c9144", + Resource = "resource164eab96", }; - Operation expectedResponse = new Operation + Policy expectedResponse = new Policy { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.CloneRules(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.CloneRules(request.FirewallPolicy); + Policy response = client.GetIamPolicy(request.Resource); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task CloneRulesAsync() + public async stt::Task GetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - CloneRulesFirewallPolicyRequest request = new CloneRulesFirewallPolicyRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); + GetIamPolicyFirewallPolicyRequest request = new GetIamPolicyFirewallPolicyRequest { - FirewallPolicy = "firewall_policy1f9c9144", + Resource = "resource164eab96", }; - Operation expectedResponse = new Operation + Policy expectedResponse = new Policy { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.CloneRulesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.CloneRulesAsync(request.FirewallPolicy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Policy responseCallSettings = await client.GetIamPolicyAsync(request.Resource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.CloneRulesAsync(request.FirewallPolicy, st::CancellationToken.None); + Policy responseCancellationToken = await client.GetIamPolicyAsync(request.Resource, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void DeleteRequestObject() + public void GetRuleRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteFirewallPolicyRequest request = new DeleteFirewallPolicyRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); + GetRuleFirewallPolicyRequest request = new GetRuleFirewallPolicyRequest { - RequestId = "request_id362c8df6", + Priority = 1546225849, FirewallPolicy = "firewall_policy1f9c9144", }; - Operation expectedResponse = new Operation + FirewallPolicyRule expectedResponse = new FirewallPolicyRule { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Match = new FirewallPolicyRuleMatcher(), + Direction = FirewallPolicyRule.Types.Direction.Ingress, + Action = "action09558c41", + Disabled = false, + EnableLogging = false, + RuleTupleCount = -1393850828, Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Priority = 1546225849, + TargetServiceAccounts = + { + "target_service_accounts61bf1663", + }, + TargetResources = + { + "target_resources1e810c06", + }, }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetRule(request, moq::It.IsAny())).Returns(expectedResponse); FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); + FirewallPolicyRule response = client.GetRule(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() + public async stt::Task GetRuleRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteFirewallPolicyRequest request = new DeleteFirewallPolicyRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); + GetRuleFirewallPolicyRequest request = new GetRuleFirewallPolicyRequest { - RequestId = "request_id362c8df6", + Priority = 1546225849, FirewallPolicy = "firewall_policy1f9c9144", }; - Operation expectedResponse = new Operation + FirewallPolicyRule expectedResponse = new FirewallPolicyRule { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Match = new FirewallPolicyRuleMatcher(), + Direction = FirewallPolicyRule.Types.Direction.Ingress, + Action = "action09558c41", + Disabled = false, + EnableLogging = false, + RuleTupleCount = -1393850828, Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Priority = 1546225849, + TargetServiceAccounts = + { + "target_service_accounts61bf1663", + }, + TargetResources = + { + "target_resources1e810c06", + }, }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetRuleAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + FirewallPolicyRule responseCallSettings = await client.GetRuleAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); + FirewallPolicyRule responseCancellationToken = await client.GetRuleAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void Delete() + public void GetRule() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteFirewallPolicyRequest request = new DeleteFirewallPolicyRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); + GetRuleFirewallPolicyRequest request = new GetRuleFirewallPolicyRequest { FirewallPolicy = "firewall_policy1f9c9144", }; - Operation expectedResponse = new Operation + FirewallPolicyRule expectedResponse = new FirewallPolicyRule { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Match = new FirewallPolicyRuleMatcher(), + Direction = FirewallPolicyRule.Types.Direction.Ingress, + Action = "action09558c41", + Disabled = false, + EnableLogging = false, + RuleTupleCount = -1393850828, Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Priority = 1546225849, + TargetServiceAccounts = + { + "target_service_accounts61bf1663", + }, + TargetResources = + { + "target_resources1e810c06", + }, }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetRule(request, moq::It.IsAny())).Returns(expectedResponse); FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.FirewallPolicy); + FirewallPolicyRule response = client.GetRule(request.FirewallPolicy); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task DeleteAsync() + public async stt::Task GetRuleAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteFirewallPolicyRequest request = new DeleteFirewallPolicyRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); + GetRuleFirewallPolicyRequest request = new GetRuleFirewallPolicyRequest { FirewallPolicy = "firewall_policy1f9c9144", }; - Operation expectedResponse = new Operation + FirewallPolicyRule expectedResponse = new FirewallPolicyRule { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Match = new FirewallPolicyRuleMatcher(), + Direction = FirewallPolicyRule.Types.Direction.Ingress, + Action = "action09558c41", + Disabled = false, + EnableLogging = false, + RuleTupleCount = -1393850828, Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Priority = 1546225849, + TargetServiceAccounts = + { + "target_service_accounts61bf1663", + }, + TargetResources = + { + "target_resources1e810c06", + }, }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetRuleAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.FirewallPolicy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + FirewallPolicyRule responseCallSettings = await client.GetRuleAsync(request.FirewallPolicy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.FirewallPolicy, st::CancellationToken.None); + FirewallPolicyRule responseCancellationToken = await client.GetRuleAsync(request.FirewallPolicy, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void GetRequestObject() + public void ListAssociationsRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetFirewallPolicyRequest request = new GetFirewallPolicyRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); + ListAssociationsFirewallPolicyRequest request = new ListAssociationsFirewallPolicyRequest { - FirewallPolicy = "firewall_policy1f9c9144", + TargetResource = "target_resource7041731f", }; - FirewallPolicy expectedResponse = new FirewallPolicy + FirewallPoliciesListAssociationsResponse expectedResponse = new FirewallPoliciesListAssociationsResponse { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - DisplayName = "display_name137f65c2", - CreationTimestamp = "creation_timestamp235e59a1", - SelfLinkWithId = "self_link_with_id6d1e3896", - Parent = "parent7858e4d0", - Rules = - { - new FirewallPolicyRule(), - }, - Fingerprint = "fingerprint009e6052", - RuleTupleCount = -1393850828, - Description = "description2cf9da67", - SelfLink = "self_link7e87f12d", - ShortName = "short_namec7ba9846", Associations = { new FirewallPolicyAssociation(), }, }; - mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.ListAssociations(request, moq::It.IsAny())).Returns(expectedResponse); FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - FirewallPolicy response = client.Get(request); + FirewallPoliciesListAssociationsResponse response = client.ListAssociations(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task GetRequestObjectAsync() + public async stt::Task ListAssociationsRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetFirewallPolicyRequest request = new GetFirewallPolicyRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); + ListAssociationsFirewallPolicyRequest request = new ListAssociationsFirewallPolicyRequest { - FirewallPolicy = "firewall_policy1f9c9144", + TargetResource = "target_resource7041731f", }; - FirewallPolicy expectedResponse = new FirewallPolicy + FirewallPoliciesListAssociationsResponse expectedResponse = new FirewallPoliciesListAssociationsResponse { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - DisplayName = "display_name137f65c2", - CreationTimestamp = "creation_timestamp235e59a1", - SelfLinkWithId = "self_link_with_id6d1e3896", - Parent = "parent7858e4d0", - Rules = - { - new FirewallPolicyRule(), - }, - Fingerprint = "fingerprint009e6052", - RuleTupleCount = -1393850828, - Description = "description2cf9da67", - SelfLink = "self_link7e87f12d", - ShortName = "short_namec7ba9846", Associations = { new FirewallPolicyAssociation(), }, }; - mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.ListAssociationsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - FirewallPolicy responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + FirewallPoliciesListAssociationsResponse responseCallSettings = await client.ListAssociationsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - FirewallPolicy responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None); + FirewallPoliciesListAssociationsResponse responseCancellationToken = await client.ListAssociationsAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void Get() + public void ListAssociations() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetFirewallPolicyRequest request = new GetFirewallPolicyRequest - { - FirewallPolicy = "firewall_policy1f9c9144", - }; - FirewallPolicy expectedResponse = new FirewallPolicy + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); + ListAssociationsFirewallPolicyRequest request = new ListAssociationsFirewallPolicyRequest { }; + FirewallPoliciesListAssociationsResponse expectedResponse = new FirewallPoliciesListAssociationsResponse { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - DisplayName = "display_name137f65c2", - CreationTimestamp = "creation_timestamp235e59a1", - SelfLinkWithId = "self_link_with_id6d1e3896", - Parent = "parent7858e4d0", - Rules = - { - new FirewallPolicyRule(), - }, - Fingerprint = "fingerprint009e6052", - RuleTupleCount = -1393850828, - Description = "description2cf9da67", - SelfLink = "self_link7e87f12d", - ShortName = "short_namec7ba9846", Associations = { new FirewallPolicyAssociation(), }, }; - mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.ListAssociations(request, moq::It.IsAny())).Returns(expectedResponse); FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - FirewallPolicy response = client.Get(request.FirewallPolicy); + FirewallPoliciesListAssociationsResponse response = client.ListAssociations(); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task GetAsync() + public async stt::Task ListAssociationsAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetFirewallPolicyRequest request = new GetFirewallPolicyRequest - { - FirewallPolicy = "firewall_policy1f9c9144", - }; - FirewallPolicy expectedResponse = new FirewallPolicy + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); + ListAssociationsFirewallPolicyRequest request = new ListAssociationsFirewallPolicyRequest { }; + FirewallPoliciesListAssociationsResponse expectedResponse = new FirewallPoliciesListAssociationsResponse { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - DisplayName = "display_name137f65c2", - CreationTimestamp = "creation_timestamp235e59a1", - SelfLinkWithId = "self_link_with_id6d1e3896", - Parent = "parent7858e4d0", - Rules = - { - new FirewallPolicyRule(), - }, - Fingerprint = "fingerprint009e6052", - RuleTupleCount = -1393850828, - Description = "description2cf9da67", - SelfLink = "self_link7e87f12d", - ShortName = "short_namec7ba9846", Associations = { new FirewallPolicyAssociation(), }, }; - mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - FirewallPolicy responseCallSettings = await client.GetAsync(request.FirewallPolicy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - FirewallPolicy responseCancellationToken = await client.GetAsync(request.FirewallPolicy, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetAssociationRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetAssociationFirewallPolicyRequest request = new GetAssociationFirewallPolicyRequest - { - Name = "name1c9368b0", - FirewallPolicy = "firewall_policy1f9c9144", - }; - FirewallPolicyAssociation expectedResponse = new FirewallPolicyAssociation - { - Name = "name1c9368b0", - DisplayName = "display_name137f65c2", - AttachmentTarget = "attachment_targetf83a4ab8", - FirewallPolicyId = "firewall_policy_id306dc2cb", - ShortName = "short_namec7ba9846", - }; - mockGrpcClient.Setup(x => x.GetAssociation(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - FirewallPolicyAssociation response = client.GetAssociation(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetAssociationRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetAssociationFirewallPolicyRequest request = new GetAssociationFirewallPolicyRequest - { - Name = "name1c9368b0", - FirewallPolicy = "firewall_policy1f9c9144", - }; - FirewallPolicyAssociation expectedResponse = new FirewallPolicyAssociation - { - Name = "name1c9368b0", - DisplayName = "display_name137f65c2", - AttachmentTarget = "attachment_targetf83a4ab8", - FirewallPolicyId = "firewall_policy_id306dc2cb", - ShortName = "short_namec7ba9846", - }; - mockGrpcClient.Setup(x => x.GetAssociationAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.ListAssociationsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - FirewallPolicyAssociation responseCallSettings = await client.GetAssociationAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + FirewallPoliciesListAssociationsResponse responseCallSettings = await client.ListAssociationsAsync(gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - FirewallPolicyAssociation responseCancellationToken = await client.GetAssociationAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetAssociation() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetAssociationFirewallPolicyRequest request = new GetAssociationFirewallPolicyRequest - { - FirewallPolicy = "firewall_policy1f9c9144", - }; - FirewallPolicyAssociation expectedResponse = new FirewallPolicyAssociation - { - Name = "name1c9368b0", - DisplayName = "display_name137f65c2", - AttachmentTarget = "attachment_targetf83a4ab8", - FirewallPolicyId = "firewall_policy_id306dc2cb", - ShortName = "short_namec7ba9846", - }; - mockGrpcClient.Setup(x => x.GetAssociation(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - FirewallPolicyAssociation response = client.GetAssociation(request.FirewallPolicy); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetAssociationAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetAssociationFirewallPolicyRequest request = new GetAssociationFirewallPolicyRequest - { - FirewallPolicy = "firewall_policy1f9c9144", - }; - FirewallPolicyAssociation expectedResponse = new FirewallPolicyAssociation - { - Name = "name1c9368b0", - DisplayName = "display_name137f65c2", - AttachmentTarget = "attachment_targetf83a4ab8", - FirewallPolicyId = "firewall_policy_id306dc2cb", - ShortName = "short_namec7ba9846", - }; - mockGrpcClient.Setup(x => x.GetAssociationAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - FirewallPolicyAssociation responseCallSettings = await client.GetAssociationAsync(request.FirewallPolicy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - FirewallPolicyAssociation responseCancellationToken = await client.GetAssociationAsync(request.FirewallPolicy, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetIamPolicyRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetIamPolicyFirewallPolicyRequest request = new GetIamPolicyFirewallPolicyRequest - { - Resource = "resource164eab96", - OptionsRequestedPolicyVersion = -1471234741, - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.GetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Policy response = client.GetIamPolicy(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetIamPolicyRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetIamPolicyFirewallPolicyRequest request = new GetIamPolicyFirewallPolicyRequest - { - Resource = "resource164eab96", - OptionsRequestedPolicyVersion = -1471234741, - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.GetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Policy responseCallSettings = await client.GetIamPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Policy responseCancellationToken = await client.GetIamPolicyAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetIamPolicy() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetIamPolicyFirewallPolicyRequest request = new GetIamPolicyFirewallPolicyRequest - { - Resource = "resource164eab96", - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.GetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Policy response = client.GetIamPolicy(request.Resource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetIamPolicyAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetIamPolicyFirewallPolicyRequest request = new GetIamPolicyFirewallPolicyRequest - { - Resource = "resource164eab96", - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.GetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Policy responseCallSettings = await client.GetIamPolicyAsync(request.Resource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Policy responseCancellationToken = await client.GetIamPolicyAsync(request.Resource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetRuleRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetRuleFirewallPolicyRequest request = new GetRuleFirewallPolicyRequest - { - Priority = 1546225849, - FirewallPolicy = "firewall_policy1f9c9144", - }; - FirewallPolicyRule expectedResponse = new FirewallPolicyRule - { - Kind = "kindf7aa39d9", - Match = new FirewallPolicyRuleMatcher(), - Direction = FirewallPolicyRule.Types.Direction.Ingress, - Action = "action09558c41", - Disabled = false, - EnableLogging = false, - RuleTupleCount = -1393850828, - Description = "description2cf9da67", - Priority = 1546225849, - TargetServiceAccounts = - { - "target_service_accounts61bf1663", - }, - TargetResources = - { - "target_resources1e810c06", - }, - }; - mockGrpcClient.Setup(x => x.GetRule(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - FirewallPolicyRule response = client.GetRule(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetRuleRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetRuleFirewallPolicyRequest request = new GetRuleFirewallPolicyRequest - { - Priority = 1546225849, - FirewallPolicy = "firewall_policy1f9c9144", - }; - FirewallPolicyRule expectedResponse = new FirewallPolicyRule - { - Kind = "kindf7aa39d9", - Match = new FirewallPolicyRuleMatcher(), - Direction = FirewallPolicyRule.Types.Direction.Ingress, - Action = "action09558c41", - Disabled = false, - EnableLogging = false, - RuleTupleCount = -1393850828, - Description = "description2cf9da67", - Priority = 1546225849, - TargetServiceAccounts = - { - "target_service_accounts61bf1663", - }, - TargetResources = - { - "target_resources1e810c06", - }, - }; - mockGrpcClient.Setup(x => x.GetRuleAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - FirewallPolicyRule responseCallSettings = await client.GetRuleAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - FirewallPolicyRule responseCancellationToken = await client.GetRuleAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetRule() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetRuleFirewallPolicyRequest request = new GetRuleFirewallPolicyRequest - { - FirewallPolicy = "firewall_policy1f9c9144", - }; - FirewallPolicyRule expectedResponse = new FirewallPolicyRule - { - Kind = "kindf7aa39d9", - Match = new FirewallPolicyRuleMatcher(), - Direction = FirewallPolicyRule.Types.Direction.Ingress, - Action = "action09558c41", - Disabled = false, - EnableLogging = false, - RuleTupleCount = -1393850828, - Description = "description2cf9da67", - Priority = 1546225849, - TargetServiceAccounts = - { - "target_service_accounts61bf1663", - }, - TargetResources = - { - "target_resources1e810c06", - }, - }; - mockGrpcClient.Setup(x => x.GetRule(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - FirewallPolicyRule response = client.GetRule(request.FirewallPolicy); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetRuleAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetRuleFirewallPolicyRequest request = new GetRuleFirewallPolicyRequest - { - FirewallPolicy = "firewall_policy1f9c9144", - }; - FirewallPolicyRule expectedResponse = new FirewallPolicyRule - { - Kind = "kindf7aa39d9", - Match = new FirewallPolicyRuleMatcher(), - Direction = FirewallPolicyRule.Types.Direction.Ingress, - Action = "action09558c41", - Disabled = false, - EnableLogging = false, - RuleTupleCount = -1393850828, - Description = "description2cf9da67", - Priority = 1546225849, - TargetServiceAccounts = - { - "target_service_accounts61bf1663", - }, - TargetResources = - { - "target_resources1e810c06", - }, - }; - mockGrpcClient.Setup(x => x.GetRuleAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - FirewallPolicyRule responseCallSettings = await client.GetRuleAsync(request.FirewallPolicy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - FirewallPolicyRule responseCancellationToken = await client.GetRuleAsync(request.FirewallPolicy, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertFirewallPolicyRequest request = new InsertFirewallPolicyRequest - { - RequestId = "request_id362c8df6", - ParentId = "parent_id8279e36b", - FirewallPolicyResource = new FirewallPolicy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertFirewallPolicyRequest request = new InsertFirewallPolicyRequest - { - RequestId = "request_id362c8df6", - ParentId = "parent_id8279e36b", - FirewallPolicyResource = new FirewallPolicy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertFirewallPolicyRequest request = new InsertFirewallPolicyRequest - { - FirewallPolicyResource = new FirewallPolicy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.FirewallPolicyResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertFirewallPolicyRequest request = new InsertFirewallPolicyRequest - { - FirewallPolicyResource = new FirewallPolicy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.FirewallPolicyResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.FirewallPolicyResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void ListAssociationsRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ListAssociationsFirewallPolicyRequest request = new ListAssociationsFirewallPolicyRequest - { - TargetResource = "target_resource7041731f", - }; - FirewallPoliciesListAssociationsResponse expectedResponse = new FirewallPoliciesListAssociationsResponse - { - Kind = "kindf7aa39d9", - Associations = - { - new FirewallPolicyAssociation(), - }, - }; - mockGrpcClient.Setup(x => x.ListAssociations(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - FirewallPoliciesListAssociationsResponse response = client.ListAssociations(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task ListAssociationsRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ListAssociationsFirewallPolicyRequest request = new ListAssociationsFirewallPolicyRequest - { - TargetResource = "target_resource7041731f", - }; - FirewallPoliciesListAssociationsResponse expectedResponse = new FirewallPoliciesListAssociationsResponse - { - Kind = "kindf7aa39d9", - Associations = - { - new FirewallPolicyAssociation(), - }, - }; - mockGrpcClient.Setup(x => x.ListAssociationsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - FirewallPoliciesListAssociationsResponse responseCallSettings = await client.ListAssociationsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - FirewallPoliciesListAssociationsResponse responseCancellationToken = await client.ListAssociationsAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void ListAssociations() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ListAssociationsFirewallPolicyRequest request = new ListAssociationsFirewallPolicyRequest { }; - FirewallPoliciesListAssociationsResponse expectedResponse = new FirewallPoliciesListAssociationsResponse - { - Kind = "kindf7aa39d9", - Associations = - { - new FirewallPolicyAssociation(), - }, - }; - mockGrpcClient.Setup(x => x.ListAssociations(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - FirewallPoliciesListAssociationsResponse response = client.ListAssociations(); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task ListAssociationsAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ListAssociationsFirewallPolicyRequest request = new ListAssociationsFirewallPolicyRequest { }; - FirewallPoliciesListAssociationsResponse expectedResponse = new FirewallPoliciesListAssociationsResponse - { - Kind = "kindf7aa39d9", - Associations = - { - new FirewallPolicyAssociation(), - }, - }; - mockGrpcClient.Setup(x => x.ListAssociationsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - FirewallPoliciesListAssociationsResponse responseCallSettings = await client.ListAssociationsAsync(gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - FirewallPoliciesListAssociationsResponse responseCancellationToken = await client.ListAssociationsAsync(st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void MoveRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - MoveFirewallPolicyRequest request = new MoveFirewallPolicyRequest - { - RequestId = "request_id362c8df6", - ParentId = "parent_id8279e36b", - FirewallPolicy = "firewall_policy1f9c9144", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Move(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Move(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task MoveRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - MoveFirewallPolicyRequest request = new MoveFirewallPolicyRequest - { - RequestId = "request_id362c8df6", - ParentId = "parent_id8279e36b", - FirewallPolicy = "firewall_policy1f9c9144", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.MoveAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.MoveAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.MoveAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Move() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - MoveFirewallPolicyRequest request = new MoveFirewallPolicyRequest - { - FirewallPolicy = "firewall_policy1f9c9144", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Move(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Move(request.FirewallPolicy); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task MoveAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - MoveFirewallPolicyRequest request = new MoveFirewallPolicyRequest - { - FirewallPolicy = "firewall_policy1f9c9144", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.MoveAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.MoveAsync(request.FirewallPolicy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.MoveAsync(request.FirewallPolicy, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchFirewallPolicyRequest request = new PatchFirewallPolicyRequest - { - RequestId = "request_id362c8df6", - FirewallPolicyResource = new FirewallPolicy(), - FirewallPolicy = "firewall_policy1f9c9144", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchFirewallPolicyRequest request = new PatchFirewallPolicyRequest - { - RequestId = "request_id362c8df6", - FirewallPolicyResource = new FirewallPolicy(), - FirewallPolicy = "firewall_policy1f9c9144", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchFirewallPolicyRequest request = new PatchFirewallPolicyRequest - { - FirewallPolicyResource = new FirewallPolicy(), - FirewallPolicy = "firewall_policy1f9c9144", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.FirewallPolicy, request.FirewallPolicyResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchFirewallPolicyRequest request = new PatchFirewallPolicyRequest - { - FirewallPolicyResource = new FirewallPolicy(), - FirewallPolicy = "firewall_policy1f9c9144", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.FirewallPolicy, request.FirewallPolicyResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.FirewallPolicy, request.FirewallPolicyResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRuleRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRuleFirewallPolicyRequest request = new PatchRuleFirewallPolicyRequest - { - RequestId = "request_id362c8df6", - FirewallPolicyRuleResource = new FirewallPolicyRule(), - Priority = 1546225849, - FirewallPolicy = "firewall_policy1f9c9144", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchRule(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.PatchRule(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRuleRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRuleFirewallPolicyRequest request = new PatchRuleFirewallPolicyRequest - { - RequestId = "request_id362c8df6", - FirewallPolicyRuleResource = new FirewallPolicyRule(), - Priority = 1546225849, - FirewallPolicy = "firewall_policy1f9c9144", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchRuleAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchRuleAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchRuleAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRule() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRuleFirewallPolicyRequest request = new PatchRuleFirewallPolicyRequest - { - FirewallPolicyRuleResource = new FirewallPolicyRule(), - FirewallPolicy = "firewall_policy1f9c9144", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchRule(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.PatchRule(request.FirewallPolicy, request.FirewallPolicyRuleResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRuleAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRuleFirewallPolicyRequest request = new PatchRuleFirewallPolicyRequest - { - FirewallPolicyRuleResource = new FirewallPolicyRule(), - FirewallPolicy = "firewall_policy1f9c9144", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchRuleAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchRuleAsync(request.FirewallPolicy, request.FirewallPolicyRuleResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchRuleAsync(request.FirewallPolicy, request.FirewallPolicyRuleResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void RemoveAssociationRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveAssociationFirewallPolicyRequest request = new RemoveAssociationFirewallPolicyRequest - { - Name = "name1c9368b0", - RequestId = "request_id362c8df6", - FirewallPolicy = "firewall_policy1f9c9144", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveAssociation(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.RemoveAssociation(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task RemoveAssociationRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveAssociationFirewallPolicyRequest request = new RemoveAssociationFirewallPolicyRequest - { - Name = "name1c9368b0", - RequestId = "request_id362c8df6", - FirewallPolicy = "firewall_policy1f9c9144", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveAssociationAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RemoveAssociationAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RemoveAssociationAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void RemoveAssociation() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveAssociationFirewallPolicyRequest request = new RemoveAssociationFirewallPolicyRequest - { - FirewallPolicy = "firewall_policy1f9c9144", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveAssociation(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.RemoveAssociation(request.FirewallPolicy); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task RemoveAssociationAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveAssociationFirewallPolicyRequest request = new RemoveAssociationFirewallPolicyRequest - { - FirewallPolicy = "firewall_policy1f9c9144", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveAssociationAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RemoveAssociationAsync(request.FirewallPolicy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RemoveAssociationAsync(request.FirewallPolicy, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void RemoveRuleRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveRuleFirewallPolicyRequest request = new RemoveRuleFirewallPolicyRequest - { - RequestId = "request_id362c8df6", - Priority = 1546225849, - FirewallPolicy = "firewall_policy1f9c9144", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveRule(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.RemoveRule(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task RemoveRuleRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveRuleFirewallPolicyRequest request = new RemoveRuleFirewallPolicyRequest - { - RequestId = "request_id362c8df6", - Priority = 1546225849, - FirewallPolicy = "firewall_policy1f9c9144", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveRuleAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RemoveRuleAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RemoveRuleAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void RemoveRule() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveRuleFirewallPolicyRequest request = new RemoveRuleFirewallPolicyRequest - { - FirewallPolicy = "firewall_policy1f9c9144", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveRule(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.RemoveRule(request.FirewallPolicy); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task RemoveRuleAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveRuleFirewallPolicyRequest request = new RemoveRuleFirewallPolicyRequest - { - FirewallPolicy = "firewall_policy1f9c9144", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveRuleAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallPoliciesClient client = new FirewallPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RemoveRuleAsync(request.FirewallPolicy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RemoveRuleAsync(request.FirewallPolicy, st::CancellationToken.None); + FirewallPoliciesListAssociationsResponse responseCancellationToken = await client.ListAssociationsAsync(st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } @@ -2392,6 +643,7 @@ public void RemoveRule() public void SetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); SetIamPolicyFirewallPolicyRequest request = new SetIamPolicyFirewallPolicyRequest { GlobalOrganizationSetPolicyRequestResource = new GlobalOrganizationSetPolicyRequest(), @@ -2417,6 +669,7 @@ public void SetIamPolicyRequestObject() public async stt::Task SetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); SetIamPolicyFirewallPolicyRequest request = new SetIamPolicyFirewallPolicyRequest { GlobalOrganizationSetPolicyRequestResource = new GlobalOrganizationSetPolicyRequest(), @@ -2444,6 +697,7 @@ public void SetIamPolicyRequestObject() public void SetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); SetIamPolicyFirewallPolicyRequest request = new SetIamPolicyFirewallPolicyRequest { GlobalOrganizationSetPolicyRequestResource = new GlobalOrganizationSetPolicyRequest(), @@ -2469,6 +723,7 @@ public void SetIamPolicy() public async stt::Task SetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); SetIamPolicyFirewallPolicyRequest request = new SetIamPolicyFirewallPolicyRequest { GlobalOrganizationSetPolicyRequestResource = new GlobalOrganizationSetPolicyRequest(), @@ -2496,6 +751,7 @@ public void SetIamPolicy() public void TestIamPermissionsRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); TestIamPermissionsFirewallPolicyRequest request = new TestIamPermissionsFirewallPolicyRequest { Resource = "resource164eab96", @@ -2519,6 +775,7 @@ public void TestIamPermissionsRequestObject() public async stt::Task TestIamPermissionsRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); TestIamPermissionsFirewallPolicyRequest request = new TestIamPermissionsFirewallPolicyRequest { Resource = "resource164eab96", @@ -2544,6 +801,7 @@ public void TestIamPermissionsRequestObject() public void TestIamPermissions() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); TestIamPermissionsFirewallPolicyRequest request = new TestIamPermissionsFirewallPolicyRequest { Resource = "resource164eab96", @@ -2567,6 +825,7 @@ public void TestIamPermissions() public async stt::Task TestIamPermissionsAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOrganizationOperations()).Returns(new moq::Mock().Object); TestIamPermissionsFirewallPolicyRequest request = new TestIamPermissionsFirewallPolicyRequest { Resource = "resource164eab96", diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/FirewallsClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/FirewallsClientTest.g.cs index 41b33cae0977..dec1474ec5ce 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/FirewallsClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/FirewallsClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,188 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedFirewallsClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteFirewallRequest request = new DeleteFirewallRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - Firewall = "firewall1a37e536", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallsClient client = new FirewallsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteFirewallRequest request = new DeleteFirewallRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - Firewall = "firewall1a37e536", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallsClient client = new FirewallsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteFirewallRequest request = new DeleteFirewallRequest - { - Project = "projectaa6ff846", - Firewall = "firewall1a37e536", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallsClient client = new FirewallsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Firewall); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteFirewallRequest request = new DeleteFirewallRequest - { - Project = "projectaa6ff846", - Firewall = "firewall1a37e536", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallsClient client = new FirewallsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Firewall, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Firewall, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetFirewallRequest request = new GetFirewallRequest { Project = "projectaa6ff846", @@ -264,6 +88,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetFirewallRequest request = new GetFirewallRequest { Project = "projectaa6ff846", @@ -322,6 +147,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetFirewallRequest request = new GetFirewallRequest { Project = "projectaa6ff846", @@ -378,6 +204,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetFirewallRequest request = new GetFirewallRequest { Project = "projectaa6ff846", @@ -431,547 +258,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertFirewallRequest request = new InsertFirewallRequest - { - RequestId = "request_id362c8df6", - FirewallResource = new Firewall(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallsClient client = new FirewallsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertFirewallRequest request = new InsertFirewallRequest - { - RequestId = "request_id362c8df6", - FirewallResource = new Firewall(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallsClient client = new FirewallsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertFirewallRequest request = new InsertFirewallRequest - { - FirewallResource = new Firewall(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallsClient client = new FirewallsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.FirewallResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertFirewallRequest request = new InsertFirewallRequest - { - FirewallResource = new Firewall(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallsClient client = new FirewallsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.FirewallResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.FirewallResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchFirewallRequest request = new PatchFirewallRequest - { - RequestId = "request_id362c8df6", - FirewallResource = new Firewall(), - Project = "projectaa6ff846", - Firewall = "firewall1a37e536", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallsClient client = new FirewallsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchFirewallRequest request = new PatchFirewallRequest - { - RequestId = "request_id362c8df6", - FirewallResource = new Firewall(), - Project = "projectaa6ff846", - Firewall = "firewall1a37e536", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallsClient client = new FirewallsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchFirewallRequest request = new PatchFirewallRequest - { - FirewallResource = new Firewall(), - Project = "projectaa6ff846", - Firewall = "firewall1a37e536", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallsClient client = new FirewallsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.Firewall, request.FirewallResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchFirewallRequest request = new PatchFirewallRequest - { - FirewallResource = new Firewall(), - Project = "projectaa6ff846", - Firewall = "firewall1a37e536", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallsClient client = new FirewallsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.Firewall, request.FirewallResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.Firewall, request.FirewallResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void UpdateRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateFirewallRequest request = new UpdateFirewallRequest - { - RequestId = "request_id362c8df6", - FirewallResource = new Firewall(), - Project = "projectaa6ff846", - Firewall = "firewall1a37e536", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallsClient client = new FirewallsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task UpdateRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateFirewallRequest request = new UpdateFirewallRequest - { - RequestId = "request_id362c8df6", - FirewallResource = new Firewall(), - Project = "projectaa6ff846", - Firewall = "firewall1a37e536", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallsClient client = new FirewallsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Update() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateFirewallRequest request = new UpdateFirewallRequest - { - FirewallResource = new Firewall(), - Project = "projectaa6ff846", - Firewall = "firewall1a37e536", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); - FirewallsClient client = new FirewallsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request.Project, request.Firewall, request.FirewallResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task UpdateAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateFirewallRequest request = new UpdateFirewallRequest - { - FirewallResource = new Firewall(), - Project = "projectaa6ff846", - Firewall = "firewall1a37e536", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - FirewallsClient client = new FirewallsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request.Project, request.Firewall, request.FirewallResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request.Project, request.Firewall, request.FirewallResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ForwardingRulesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ForwardingRulesClientTest.g.cs index 64cd23df6aa3..775c25853570 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ForwardingRulesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ForwardingRulesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedForwardingRulesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteForwardingRuleRequest request = new DeleteForwardingRuleRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - ForwardingRulesClient client = new ForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteForwardingRuleRequest request = new DeleteForwardingRuleRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ForwardingRulesClient client = new ForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteForwardingRuleRequest request = new DeleteForwardingRuleRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - ForwardingRulesClient client = new ForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.ForwardingRule); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteForwardingRuleRequest request = new DeleteForwardingRuleRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ForwardingRulesClient client = new ForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.ForwardingRule, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.ForwardingRule, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetForwardingRuleRequest request = new GetForwardingRuleRequest { Region = "regionedb20d96", @@ -273,6 +93,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetForwardingRuleRequest request = new GetForwardingRuleRequest { Region = "regionedb20d96", @@ -336,6 +157,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetForwardingRuleRequest request = new GetForwardingRuleRequest { Region = "regionedb20d96", @@ -397,6 +219,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetForwardingRuleRequest request = new GetForwardingRuleRequest { Region = "regionedb20d96", @@ -455,745 +278,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertForwardingRuleRequest request = new InsertForwardingRuleRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - ForwardingRuleResource = new ForwardingRule(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - ForwardingRulesClient client = new ForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertForwardingRuleRequest request = new InsertForwardingRuleRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - ForwardingRuleResource = new ForwardingRule(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ForwardingRulesClient client = new ForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertForwardingRuleRequest request = new InsertForwardingRuleRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - ForwardingRuleResource = new ForwardingRule(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - ForwardingRulesClient client = new ForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.ForwardingRuleResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertForwardingRuleRequest request = new InsertForwardingRuleRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - ForwardingRuleResource = new ForwardingRule(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ForwardingRulesClient client = new ForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.ForwardingRuleResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.ForwardingRuleResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchForwardingRuleRequest request = new PatchForwardingRuleRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - ForwardingRuleResource = new ForwardingRule(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - ForwardingRulesClient client = new ForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchForwardingRuleRequest request = new PatchForwardingRuleRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - ForwardingRuleResource = new ForwardingRule(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ForwardingRulesClient client = new ForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchForwardingRuleRequest request = new PatchForwardingRuleRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - ForwardingRuleResource = new ForwardingRule(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - ForwardingRulesClient client = new ForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.Region, request.ForwardingRule, request.ForwardingRuleResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchForwardingRuleRequest request = new PatchForwardingRuleRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - ForwardingRuleResource = new ForwardingRule(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ForwardingRulesClient client = new ForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.Region, request.ForwardingRule, request.ForwardingRuleResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.Region, request.ForwardingRule, request.ForwardingRuleResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetLabelsRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsForwardingRuleRequest request = new SetLabelsForwardingRuleRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Resource = "resource164eab96", - Project = "projectaa6ff846", - RegionSetLabelsRequestResource = new RegionSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabels(request, moq::It.IsAny())).Returns(expectedResponse); - ForwardingRulesClient client = new ForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetLabels(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetLabelsRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsForwardingRuleRequest request = new SetLabelsForwardingRuleRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Resource = "resource164eab96", - Project = "projectaa6ff846", - RegionSetLabelsRequestResource = new RegionSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabelsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ForwardingRulesClient client = new ForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetLabelsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetLabelsAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetLabels() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsForwardingRuleRequest request = new SetLabelsForwardingRuleRequest - { - Region = "regionedb20d96", - Resource = "resource164eab96", - Project = "projectaa6ff846", - RegionSetLabelsRequestResource = new RegionSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabels(request, moq::It.IsAny())).Returns(expectedResponse); - ForwardingRulesClient client = new ForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetLabels(request.Project, request.Region, request.Resource, request.RegionSetLabelsRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetLabelsAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsForwardingRuleRequest request = new SetLabelsForwardingRuleRequest - { - Region = "regionedb20d96", - Resource = "resource164eab96", - Project = "projectaa6ff846", - RegionSetLabelsRequestResource = new RegionSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabelsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ForwardingRulesClient client = new ForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetLabelsAsync(request.Project, request.Region, request.Resource, request.RegionSetLabelsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetLabelsAsync(request.Project, request.Region, request.Resource, request.RegionSetLabelsRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetTargetRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetTargetForwardingRuleRequest request = new SetTargetForwardingRuleRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - TargetReferenceResource = new TargetReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetTarget(request, moq::It.IsAny())).Returns(expectedResponse); - ForwardingRulesClient client = new ForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetTarget(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetTargetRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetTargetForwardingRuleRequest request = new SetTargetForwardingRuleRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - TargetReferenceResource = new TargetReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetTargetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ForwardingRulesClient client = new ForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetTargetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetTargetAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetTarget() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetTargetForwardingRuleRequest request = new SetTargetForwardingRuleRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - TargetReferenceResource = new TargetReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetTarget(request, moq::It.IsAny())).Returns(expectedResponse); - ForwardingRulesClient client = new ForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetTarget(request.Project, request.Region, request.ForwardingRule, request.TargetReferenceResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetTargetAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetTargetForwardingRuleRequest request = new SetTargetForwardingRuleRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - TargetReferenceResource = new TargetReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetTargetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ForwardingRulesClient client = new ForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetTargetAsync(request.Project, request.Region, request.ForwardingRule, request.TargetReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetTargetAsync(request.Project, request.Region, request.ForwardingRule, request.TargetReferenceResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/GlobalAddressesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/GlobalAddressesClientTest.g.cs index 7be78cf16fbd..95663e86591c 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/GlobalAddressesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/GlobalAddressesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,188 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedGlobalAddressesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteGlobalAddressRequest request = new DeleteGlobalAddressRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - Address = "address04984d88", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalAddressesClient client = new GlobalAddressesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteGlobalAddressRequest request = new DeleteGlobalAddressRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - Address = "address04984d88", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalAddressesClient client = new GlobalAddressesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteGlobalAddressRequest request = new DeleteGlobalAddressRequest - { - Project = "projectaa6ff846", - Address = "address04984d88", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalAddressesClient client = new GlobalAddressesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Address); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteGlobalAddressRequest request = new DeleteGlobalAddressRequest - { - Project = "projectaa6ff846", - Address = "address04984d88", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalAddressesClient client = new GlobalAddressesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Address, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Address, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetGlobalAddressRequest request = new GetGlobalAddressRequest { Project = "projectaa6ff846", @@ -244,6 +68,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetGlobalAddressRequest request = new GetGlobalAddressRequest { Project = "projectaa6ff846", @@ -282,6 +107,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetGlobalAddressRequest request = new GetGlobalAddressRequest { Project = "projectaa6ff846", @@ -318,6 +144,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetGlobalAddressRequest request = new GetGlobalAddressRequest { Project = "projectaa6ff846", @@ -351,183 +178,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertGlobalAddressRequest request = new InsertGlobalAddressRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - AddressResource = new Address(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalAddressesClient client = new GlobalAddressesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertGlobalAddressRequest request = new InsertGlobalAddressRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - AddressResource = new Address(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalAddressesClient client = new GlobalAddressesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertGlobalAddressRequest request = new InsertGlobalAddressRequest - { - Project = "projectaa6ff846", - AddressResource = new Address(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalAddressesClient client = new GlobalAddressesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.AddressResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertGlobalAddressRequest request = new InsertGlobalAddressRequest - { - Project = "projectaa6ff846", - AddressResource = new Address(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalAddressesClient client = new GlobalAddressesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.AddressResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.AddressResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/GlobalForwardingRulesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/GlobalForwardingRulesClientTest.g.cs index 466d44dea66e..6da5cb57722d 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/GlobalForwardingRulesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/GlobalForwardingRulesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,188 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedGlobalForwardingRulesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteGlobalForwardingRuleRequest request = new DeleteGlobalForwardingRuleRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalForwardingRulesClient client = new GlobalForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteGlobalForwardingRuleRequest request = new DeleteGlobalForwardingRuleRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalForwardingRulesClient client = new GlobalForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteGlobalForwardingRuleRequest request = new DeleteGlobalForwardingRuleRequest - { - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalForwardingRulesClient client = new GlobalForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.ForwardingRule); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteGlobalForwardingRuleRequest request = new DeleteGlobalForwardingRuleRequest - { - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalForwardingRulesClient client = new GlobalForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.ForwardingRule, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.ForwardingRule, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetGlobalForwardingRuleRequest request = new GetGlobalForwardingRuleRequest { Project = "projectaa6ff846", @@ -268,6 +92,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetGlobalForwardingRuleRequest request = new GetGlobalForwardingRuleRequest { Project = "projectaa6ff846", @@ -330,6 +155,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetGlobalForwardingRuleRequest request = new GetGlobalForwardingRuleRequest { Project = "projectaa6ff846", @@ -390,6 +216,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetGlobalForwardingRuleRequest request = new GetGlobalForwardingRuleRequest { Project = "projectaa6ff846", @@ -447,727 +274,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertGlobalForwardingRuleRequest request = new InsertGlobalForwardingRuleRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - ForwardingRuleResource = new ForwardingRule(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalForwardingRulesClient client = new GlobalForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertGlobalForwardingRuleRequest request = new InsertGlobalForwardingRuleRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - ForwardingRuleResource = new ForwardingRule(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalForwardingRulesClient client = new GlobalForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertGlobalForwardingRuleRequest request = new InsertGlobalForwardingRuleRequest - { - Project = "projectaa6ff846", - ForwardingRuleResource = new ForwardingRule(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalForwardingRulesClient client = new GlobalForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.ForwardingRuleResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertGlobalForwardingRuleRequest request = new InsertGlobalForwardingRuleRequest - { - Project = "projectaa6ff846", - ForwardingRuleResource = new ForwardingRule(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalForwardingRulesClient client = new GlobalForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.ForwardingRuleResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.ForwardingRuleResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchGlobalForwardingRuleRequest request = new PatchGlobalForwardingRuleRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - ForwardingRuleResource = new ForwardingRule(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalForwardingRulesClient client = new GlobalForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchGlobalForwardingRuleRequest request = new PatchGlobalForwardingRuleRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - ForwardingRuleResource = new ForwardingRule(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalForwardingRulesClient client = new GlobalForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchGlobalForwardingRuleRequest request = new PatchGlobalForwardingRuleRequest - { - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - ForwardingRuleResource = new ForwardingRule(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalForwardingRulesClient client = new GlobalForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.ForwardingRule, request.ForwardingRuleResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchGlobalForwardingRuleRequest request = new PatchGlobalForwardingRuleRequest - { - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - ForwardingRuleResource = new ForwardingRule(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalForwardingRulesClient client = new GlobalForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.ForwardingRule, request.ForwardingRuleResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.ForwardingRule, request.ForwardingRuleResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetLabelsRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsGlobalForwardingRuleRequest request = new SetLabelsGlobalForwardingRuleRequest - { - Resource = "resource164eab96", - Project = "projectaa6ff846", - GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabels(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalForwardingRulesClient client = new GlobalForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetLabels(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetLabelsRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsGlobalForwardingRuleRequest request = new SetLabelsGlobalForwardingRuleRequest - { - Resource = "resource164eab96", - Project = "projectaa6ff846", - GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabelsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalForwardingRulesClient client = new GlobalForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetLabelsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetLabelsAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetLabels() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsGlobalForwardingRuleRequest request = new SetLabelsGlobalForwardingRuleRequest - { - Resource = "resource164eab96", - Project = "projectaa6ff846", - GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabels(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalForwardingRulesClient client = new GlobalForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetLabels(request.Project, request.Resource, request.GlobalSetLabelsRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetLabelsAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsGlobalForwardingRuleRequest request = new SetLabelsGlobalForwardingRuleRequest - { - Resource = "resource164eab96", - Project = "projectaa6ff846", - GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabelsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalForwardingRulesClient client = new GlobalForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetLabelsAsync(request.Project, request.Resource, request.GlobalSetLabelsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetLabelsAsync(request.Project, request.Resource, request.GlobalSetLabelsRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetTargetRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetTargetGlobalForwardingRuleRequest request = new SetTargetGlobalForwardingRuleRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - TargetReferenceResource = new TargetReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetTarget(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalForwardingRulesClient client = new GlobalForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetTarget(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetTargetRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetTargetGlobalForwardingRuleRequest request = new SetTargetGlobalForwardingRuleRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - TargetReferenceResource = new TargetReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetTargetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalForwardingRulesClient client = new GlobalForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetTargetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetTargetAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetTarget() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetTargetGlobalForwardingRuleRequest request = new SetTargetGlobalForwardingRuleRequest - { - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - TargetReferenceResource = new TargetReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetTarget(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalForwardingRulesClient client = new GlobalForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetTarget(request.Project, request.ForwardingRule, request.TargetReferenceResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetTargetAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetTargetGlobalForwardingRuleRequest request = new SetTargetGlobalForwardingRuleRequest - { - Project = "projectaa6ff846", - ForwardingRule = "forwarding_rule51d5478e", - TargetReferenceResource = new TargetReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetTargetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalForwardingRulesClient client = new GlobalForwardingRulesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetTargetAsync(request.Project, request.ForwardingRule, request.TargetReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetTargetAsync(request.Project, request.ForwardingRule, request.TargetReferenceResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/GlobalNetworkEndpointGroupsClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/GlobalNetworkEndpointGroupsClientTest.g.cs index e92f52762f7d..4c9093ca438a 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/GlobalNetworkEndpointGroupsClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/GlobalNetworkEndpointGroupsClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,552 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedGlobalNetworkEndpointGroupsClientTest { - [xunit::FactAttribute] - public void AttachNetworkEndpointsRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest request = new AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest - { - GlobalNetworkEndpointGroupsAttachEndpointsRequestResource = new GlobalNetworkEndpointGroupsAttachEndpointsRequest(), - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AttachNetworkEndpoints(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalNetworkEndpointGroupsClient client = new GlobalNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.AttachNetworkEndpoints(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AttachNetworkEndpointsRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest request = new AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest - { - GlobalNetworkEndpointGroupsAttachEndpointsRequestResource = new GlobalNetworkEndpointGroupsAttachEndpointsRequest(), - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AttachNetworkEndpointsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalNetworkEndpointGroupsClient client = new GlobalNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AttachNetworkEndpointsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AttachNetworkEndpointsAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void AttachNetworkEndpoints() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest request = new AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest - { - GlobalNetworkEndpointGroupsAttachEndpointsRequestResource = new GlobalNetworkEndpointGroupsAttachEndpointsRequest(), - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AttachNetworkEndpoints(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalNetworkEndpointGroupsClient client = new GlobalNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.AttachNetworkEndpoints(request.Project, request.NetworkEndpointGroup, request.GlobalNetworkEndpointGroupsAttachEndpointsRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AttachNetworkEndpointsAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest request = new AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest - { - GlobalNetworkEndpointGroupsAttachEndpointsRequestResource = new GlobalNetworkEndpointGroupsAttachEndpointsRequest(), - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AttachNetworkEndpointsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalNetworkEndpointGroupsClient client = new GlobalNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AttachNetworkEndpointsAsync(request.Project, request.NetworkEndpointGroup, request.GlobalNetworkEndpointGroupsAttachEndpointsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AttachNetworkEndpointsAsync(request.Project, request.NetworkEndpointGroup, request.GlobalNetworkEndpointGroupsAttachEndpointsRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteGlobalNetworkEndpointGroupRequest request = new DeleteGlobalNetworkEndpointGroupRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalNetworkEndpointGroupsClient client = new GlobalNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteGlobalNetworkEndpointGroupRequest request = new DeleteGlobalNetworkEndpointGroupRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalNetworkEndpointGroupsClient client = new GlobalNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteGlobalNetworkEndpointGroupRequest request = new DeleteGlobalNetworkEndpointGroupRequest - { - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalNetworkEndpointGroupsClient client = new GlobalNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.NetworkEndpointGroup); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteGlobalNetworkEndpointGroupRequest request = new DeleteGlobalNetworkEndpointGroupRequest - { - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalNetworkEndpointGroupsClient client = new GlobalNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.NetworkEndpointGroup, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.NetworkEndpointGroup, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DetachNetworkEndpointsRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest request = new DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest - { - GlobalNetworkEndpointGroupsDetachEndpointsRequestResource = new GlobalNetworkEndpointGroupsDetachEndpointsRequest(), - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DetachNetworkEndpoints(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalNetworkEndpointGroupsClient client = new GlobalNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.DetachNetworkEndpoints(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DetachNetworkEndpointsRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest request = new DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest - { - GlobalNetworkEndpointGroupsDetachEndpointsRequestResource = new GlobalNetworkEndpointGroupsDetachEndpointsRequest(), - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DetachNetworkEndpointsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalNetworkEndpointGroupsClient client = new GlobalNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DetachNetworkEndpointsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DetachNetworkEndpointsAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DetachNetworkEndpoints() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest request = new DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest - { - GlobalNetworkEndpointGroupsDetachEndpointsRequestResource = new GlobalNetworkEndpointGroupsDetachEndpointsRequest(), - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DetachNetworkEndpoints(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalNetworkEndpointGroupsClient client = new GlobalNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.DetachNetworkEndpoints(request.Project, request.NetworkEndpointGroup, request.GlobalNetworkEndpointGroupsDetachEndpointsRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DetachNetworkEndpointsAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest request = new DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest - { - GlobalNetworkEndpointGroupsDetachEndpointsRequestResource = new GlobalNetworkEndpointGroupsDetachEndpointsRequest(), - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DetachNetworkEndpointsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalNetworkEndpointGroupsClient client = new GlobalNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DetachNetworkEndpointsAsync(request.Project, request.NetworkEndpointGroup, request.GlobalNetworkEndpointGroupsDetachEndpointsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DetachNetworkEndpointsAsync(request.Project, request.NetworkEndpointGroup, request.GlobalNetworkEndpointGroupsDetachEndpointsRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetGlobalNetworkEndpointGroupRequest request = new GetGlobalNetworkEndpointGroupRequest { Project = "projectaa6ff846", @@ -614,6 +74,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetGlobalNetworkEndpointGroupRequest request = new GetGlobalNetworkEndpointGroupRequest { Project = "projectaa6ff846", @@ -658,6 +119,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetGlobalNetworkEndpointGroupRequest request = new GetGlobalNetworkEndpointGroupRequest { Project = "projectaa6ff846", @@ -700,6 +162,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetGlobalNetworkEndpointGroupRequest request = new GetGlobalNetworkEndpointGroupRequest { Project = "projectaa6ff846", @@ -739,183 +202,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertGlobalNetworkEndpointGroupRequest request = new InsertGlobalNetworkEndpointGroupRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - NetworkEndpointGroupResource = new NetworkEndpointGroup(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalNetworkEndpointGroupsClient client = new GlobalNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertGlobalNetworkEndpointGroupRequest request = new InsertGlobalNetworkEndpointGroupRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - NetworkEndpointGroupResource = new NetworkEndpointGroup(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalNetworkEndpointGroupsClient client = new GlobalNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertGlobalNetworkEndpointGroupRequest request = new InsertGlobalNetworkEndpointGroupRequest - { - Project = "projectaa6ff846", - NetworkEndpointGroupResource = new NetworkEndpointGroup(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalNetworkEndpointGroupsClient client = new GlobalNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.NetworkEndpointGroupResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertGlobalNetworkEndpointGroupRequest request = new InsertGlobalNetworkEndpointGroupRequest - { - Project = "projectaa6ff846", - NetworkEndpointGroupResource = new NetworkEndpointGroup(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalNetworkEndpointGroupsClient client = new GlobalNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.NetworkEndpointGroupResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.NetworkEndpointGroupResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/GlobalPublicDelegatedPrefixesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/GlobalPublicDelegatedPrefixesClientTest.g.cs index 81253fa6d62e..e2b4226907f9 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/GlobalPublicDelegatedPrefixesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/GlobalPublicDelegatedPrefixesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,188 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedGlobalPublicDelegatedPrefixesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteGlobalPublicDelegatedPrefixeRequest request = new DeleteGlobalPublicDelegatedPrefixeRequest - { - RequestId = "request_id362c8df6", - PublicDelegatedPrefix = "public_delegated_prefixff04d704", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalPublicDelegatedPrefixesClient client = new GlobalPublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteGlobalPublicDelegatedPrefixeRequest request = new DeleteGlobalPublicDelegatedPrefixeRequest - { - RequestId = "request_id362c8df6", - PublicDelegatedPrefix = "public_delegated_prefixff04d704", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalPublicDelegatedPrefixesClient client = new GlobalPublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteGlobalPublicDelegatedPrefixeRequest request = new DeleteGlobalPublicDelegatedPrefixeRequest - { - PublicDelegatedPrefix = "public_delegated_prefixff04d704", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalPublicDelegatedPrefixesClient client = new GlobalPublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.PublicDelegatedPrefix); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteGlobalPublicDelegatedPrefixeRequest request = new DeleteGlobalPublicDelegatedPrefixeRequest - { - PublicDelegatedPrefix = "public_delegated_prefixff04d704", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalPublicDelegatedPrefixesClient client = new GlobalPublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.PublicDelegatedPrefix, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.PublicDelegatedPrefix, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetGlobalPublicDelegatedPrefixeRequest request = new GetGlobalPublicDelegatedPrefixeRequest { PublicDelegatedPrefix = "public_delegated_prefixff04d704", @@ -243,6 +67,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetGlobalPublicDelegatedPrefixeRequest request = new GetGlobalPublicDelegatedPrefixeRequest { PublicDelegatedPrefix = "public_delegated_prefixff04d704", @@ -280,6 +105,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetGlobalPublicDelegatedPrefixeRequest request = new GetGlobalPublicDelegatedPrefixeRequest { PublicDelegatedPrefix = "public_delegated_prefixff04d704", @@ -315,6 +141,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetGlobalPublicDelegatedPrefixeRequest request = new GetGlobalPublicDelegatedPrefixeRequest { PublicDelegatedPrefix = "public_delegated_prefixff04d704", @@ -347,365 +174,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertGlobalPublicDelegatedPrefixeRequest request = new InsertGlobalPublicDelegatedPrefixeRequest - { - RequestId = "request_id362c8df6", - PublicDelegatedPrefixResource = new PublicDelegatedPrefix(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalPublicDelegatedPrefixesClient client = new GlobalPublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertGlobalPublicDelegatedPrefixeRequest request = new InsertGlobalPublicDelegatedPrefixeRequest - { - RequestId = "request_id362c8df6", - PublicDelegatedPrefixResource = new PublicDelegatedPrefix(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalPublicDelegatedPrefixesClient client = new GlobalPublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertGlobalPublicDelegatedPrefixeRequest request = new InsertGlobalPublicDelegatedPrefixeRequest - { - PublicDelegatedPrefixResource = new PublicDelegatedPrefix(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalPublicDelegatedPrefixesClient client = new GlobalPublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.PublicDelegatedPrefixResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertGlobalPublicDelegatedPrefixeRequest request = new InsertGlobalPublicDelegatedPrefixeRequest - { - PublicDelegatedPrefixResource = new PublicDelegatedPrefix(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalPublicDelegatedPrefixesClient client = new GlobalPublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.PublicDelegatedPrefixResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.PublicDelegatedPrefixResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchGlobalPublicDelegatedPrefixeRequest request = new PatchGlobalPublicDelegatedPrefixeRequest - { - RequestId = "request_id362c8df6", - PublicDelegatedPrefixResource = new PublicDelegatedPrefix(), - PublicDelegatedPrefix = "public_delegated_prefixff04d704", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalPublicDelegatedPrefixesClient client = new GlobalPublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchGlobalPublicDelegatedPrefixeRequest request = new PatchGlobalPublicDelegatedPrefixeRequest - { - RequestId = "request_id362c8df6", - PublicDelegatedPrefixResource = new PublicDelegatedPrefix(), - PublicDelegatedPrefix = "public_delegated_prefixff04d704", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalPublicDelegatedPrefixesClient client = new GlobalPublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchGlobalPublicDelegatedPrefixeRequest request = new PatchGlobalPublicDelegatedPrefixeRequest - { - PublicDelegatedPrefixResource = new PublicDelegatedPrefix(), - PublicDelegatedPrefix = "public_delegated_prefixff04d704", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - GlobalPublicDelegatedPrefixesClient client = new GlobalPublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.PublicDelegatedPrefix, request.PublicDelegatedPrefixResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchGlobalPublicDelegatedPrefixeRequest request = new PatchGlobalPublicDelegatedPrefixeRequest - { - PublicDelegatedPrefixResource = new PublicDelegatedPrefix(), - PublicDelegatedPrefix = "public_delegated_prefixff04d704", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - GlobalPublicDelegatedPrefixesClient client = new GlobalPublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.PublicDelegatedPrefix, request.PublicDelegatedPrefixResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.PublicDelegatedPrefix, request.PublicDelegatedPrefixResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/HealthChecksClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/HealthChecksClientTest.g.cs index 3f286a01c040..aa3c9c44799c 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/HealthChecksClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/HealthChecksClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,188 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedHealthChecksClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteHealthCheckRequest request = new DeleteHealthCheckRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - HealthChecksClient client = new HealthChecksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteHealthCheckRequest request = new DeleteHealthCheckRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - HealthChecksClient client = new HealthChecksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteHealthCheckRequest request = new DeleteHealthCheckRequest - { - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - HealthChecksClient client = new HealthChecksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.HealthCheck); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteHealthCheckRequest request = new DeleteHealthCheckRequest - { - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - HealthChecksClient client = new HealthChecksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.HealthCheck, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.HealthCheck, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetHealthCheckRequest request = new GetHealthCheckRequest { Project = "projectaa6ff846", @@ -246,6 +70,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetHealthCheckRequest request = new GetHealthCheckRequest { Project = "projectaa6ff846", @@ -286,6 +111,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetHealthCheckRequest request = new GetHealthCheckRequest { Project = "projectaa6ff846", @@ -324,6 +150,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetHealthCheckRequest request = new GetHealthCheckRequest { Project = "projectaa6ff846", @@ -359,547 +186,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertHealthCheckRequest request = new InsertHealthCheckRequest - { - RequestId = "request_id362c8df6", - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - HealthChecksClient client = new HealthChecksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertHealthCheckRequest request = new InsertHealthCheckRequest - { - RequestId = "request_id362c8df6", - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - HealthChecksClient client = new HealthChecksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertHealthCheckRequest request = new InsertHealthCheckRequest - { - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - HealthChecksClient client = new HealthChecksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.HealthCheckResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertHealthCheckRequest request = new InsertHealthCheckRequest - { - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - HealthChecksClient client = new HealthChecksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.HealthCheckResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.HealthCheckResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchHealthCheckRequest request = new PatchHealthCheckRequest - { - RequestId = "request_id362c8df6", - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - HealthChecksClient client = new HealthChecksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchHealthCheckRequest request = new PatchHealthCheckRequest - { - RequestId = "request_id362c8df6", - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - HealthChecksClient client = new HealthChecksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchHealthCheckRequest request = new PatchHealthCheckRequest - { - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - HealthChecksClient client = new HealthChecksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.HealthCheck, request.HealthCheckResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchHealthCheckRequest request = new PatchHealthCheckRequest - { - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - HealthChecksClient client = new HealthChecksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.HealthCheck, request.HealthCheckResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.HealthCheck, request.HealthCheckResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void UpdateRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateHealthCheckRequest request = new UpdateHealthCheckRequest - { - RequestId = "request_id362c8df6", - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); - HealthChecksClient client = new HealthChecksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task UpdateRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateHealthCheckRequest request = new UpdateHealthCheckRequest - { - RequestId = "request_id362c8df6", - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - HealthChecksClient client = new HealthChecksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Update() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateHealthCheckRequest request = new UpdateHealthCheckRequest - { - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); - HealthChecksClient client = new HealthChecksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request.Project, request.HealthCheck, request.HealthCheckResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task UpdateAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateHealthCheckRequest request = new UpdateHealthCheckRequest - { - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - HealthChecksClient client = new HealthChecksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request.Project, request.HealthCheck, request.HealthCheckResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request.Project, request.HealthCheck, request.HealthCheckResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ImagesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ImagesClientTest.g.cs index de4a17d2f0bf..cb4116d20ff8 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ImagesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ImagesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,370 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedImagesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteImageRequest request = new DeleteImageRequest - { - RequestId = "request_id362c8df6", - Image = "image225a8078", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - ImagesClient client = new ImagesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteImageRequest request = new DeleteImageRequest - { - RequestId = "request_id362c8df6", - Image = "image225a8078", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ImagesClient client = new ImagesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteImageRequest request = new DeleteImageRequest - { - Image = "image225a8078", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - ImagesClient client = new ImagesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Image); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteImageRequest request = new DeleteImageRequest - { - Image = "image225a8078", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ImagesClient client = new ImagesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Image, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Image, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeprecateRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeprecateImageRequest request = new DeprecateImageRequest - { - RequestId = "request_id362c8df6", - Image = "image225a8078", - Project = "projectaa6ff846", - DeprecationStatusResource = new DeprecationStatus(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Deprecate(request, moq::It.IsAny())).Returns(expectedResponse); - ImagesClient client = new ImagesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Deprecate(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeprecateRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeprecateImageRequest request = new DeprecateImageRequest - { - RequestId = "request_id362c8df6", - Image = "image225a8078", - Project = "projectaa6ff846", - DeprecationStatusResource = new DeprecationStatus(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeprecateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ImagesClient client = new ImagesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeprecateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeprecateAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Deprecate() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeprecateImageRequest request = new DeprecateImageRequest - { - Image = "image225a8078", - Project = "projectaa6ff846", - DeprecationStatusResource = new DeprecationStatus(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Deprecate(request, moq::It.IsAny())).Returns(expectedResponse); - ImagesClient client = new ImagesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Deprecate(request.Project, request.Image, request.DeprecationStatusResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeprecateAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeprecateImageRequest request = new DeprecateImageRequest - { - Image = "image225a8078", - Project = "projectaa6ff846", - DeprecationStatusResource = new DeprecationStatus(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeprecateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ImagesClient client = new ImagesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeprecateAsync(request.Project, request.Image, request.DeprecationStatusResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeprecateAsync(request.Project, request.Image, request.DeprecationStatusResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetImageRequest request = new GetImageRequest { Image = "image225a8078", @@ -458,6 +100,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetImageRequest request = new GetImageRequest { Image = "image225a8078", @@ -528,6 +171,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetImageRequest request = new GetImageRequest { Image = "image225a8078", @@ -596,6 +240,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetImageRequest request = new GetImageRequest { Image = "image225a8078", @@ -666,6 +311,7 @@ public void Get() public void GetFromFamilyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetFromFamilyImageRequest request = new GetFromFamilyImageRequest { Project = "projectaa6ff846", @@ -734,6 +380,7 @@ public void GetFromFamilyRequestObject() public async stt::Task GetFromFamilyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetFromFamilyImageRequest request = new GetFromFamilyImageRequest { Project = "projectaa6ff846", @@ -804,6 +451,7 @@ public void GetFromFamilyRequestObject() public void GetFromFamily() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetFromFamilyImageRequest request = new GetFromFamilyImageRequest { Project = "projectaa6ff846", @@ -872,6 +520,7 @@ public void GetFromFamily() public async stt::Task GetFromFamilyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetFromFamilyImageRequest request = new GetFromFamilyImageRequest { Project = "projectaa6ff846", @@ -942,6 +591,7 @@ public void GetFromFamily() public void GetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetIamPolicyImageRequest request = new GetIamPolicyImageRequest { Resource = "resource164eab96", @@ -968,6 +618,7 @@ public void GetIamPolicyRequestObject() public async stt::Task GetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetIamPolicyImageRequest request = new GetIamPolicyImageRequest { Resource = "resource164eab96", @@ -996,6 +647,7 @@ public void GetIamPolicyRequestObject() public void GetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetIamPolicyImageRequest request = new GetIamPolicyImageRequest { Resource = "resource164eab96", @@ -1021,6 +673,7 @@ public void GetIamPolicy() public async stt::Task GetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetIamPolicyImageRequest request = new GetIamPolicyImageRequest { Resource = "resource164eab96", @@ -1044,372 +697,11 @@ public void GetIamPolicy() mockGrpcClient.VerifyAll(); } - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertImageRequest request = new InsertImageRequest - { - RequestId = "request_id362c8df6", - ForceCreate = false, - Project = "projectaa6ff846", - ImageResource = new Image(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - ImagesClient client = new ImagesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertImageRequest request = new InsertImageRequest - { - RequestId = "request_id362c8df6", - ForceCreate = false, - Project = "projectaa6ff846", - ImageResource = new Image(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ImagesClient client = new ImagesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertImageRequest request = new InsertImageRequest - { - Project = "projectaa6ff846", - ImageResource = new Image(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - ImagesClient client = new ImagesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.ImageResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertImageRequest request = new InsertImageRequest - { - Project = "projectaa6ff846", - ImageResource = new Image(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ImagesClient client = new ImagesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.ImageResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.ImageResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchImageRequest request = new PatchImageRequest - { - RequestId = "request_id362c8df6", - Image = "image225a8078", - Project = "projectaa6ff846", - ImageResource = new Image(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - ImagesClient client = new ImagesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchImageRequest request = new PatchImageRequest - { - RequestId = "request_id362c8df6", - Image = "image225a8078", - Project = "projectaa6ff846", - ImageResource = new Image(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ImagesClient client = new ImagesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchImageRequest request = new PatchImageRequest - { - Image = "image225a8078", - Project = "projectaa6ff846", - ImageResource = new Image(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - ImagesClient client = new ImagesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.Image, request.ImageResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchImageRequest request = new PatchImageRequest - { - Image = "image225a8078", - Project = "projectaa6ff846", - ImageResource = new Image(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ImagesClient client = new ImagesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.Image, request.ImageResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.Image, request.ImageResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void SetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); SetIamPolicyImageRequest request = new SetIamPolicyImageRequest { Resource = "resource164eab96", @@ -1436,6 +728,7 @@ public void SetIamPolicyRequestObject() public async stt::Task SetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); SetIamPolicyImageRequest request = new SetIamPolicyImageRequest { Resource = "resource164eab96", @@ -1464,6 +757,7 @@ public void SetIamPolicyRequestObject() public void SetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); SetIamPolicyImageRequest request = new SetIamPolicyImageRequest { Resource = "resource164eab96", @@ -1490,6 +784,7 @@ public void SetIamPolicy() public async stt::Task SetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); SetIamPolicyImageRequest request = new SetIamPolicyImageRequest { Resource = "resource164eab96", @@ -1514,190 +809,11 @@ public void SetIamPolicy() mockGrpcClient.VerifyAll(); } - [xunit::FactAttribute] - public void SetLabelsRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsImageRequest request = new SetLabelsImageRequest - { - Resource = "resource164eab96", - Project = "projectaa6ff846", - GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabels(request, moq::It.IsAny())).Returns(expectedResponse); - ImagesClient client = new ImagesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetLabels(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetLabelsRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsImageRequest request = new SetLabelsImageRequest - { - Resource = "resource164eab96", - Project = "projectaa6ff846", - GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabelsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ImagesClient client = new ImagesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetLabelsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetLabelsAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetLabels() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsImageRequest request = new SetLabelsImageRequest - { - Resource = "resource164eab96", - Project = "projectaa6ff846", - GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabels(request, moq::It.IsAny())).Returns(expectedResponse); - ImagesClient client = new ImagesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetLabels(request.Project, request.Resource, request.GlobalSetLabelsRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetLabelsAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsImageRequest request = new SetLabelsImageRequest - { - Resource = "resource164eab96", - Project = "projectaa6ff846", - GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabelsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ImagesClient client = new ImagesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetLabelsAsync(request.Project, request.Resource, request.GlobalSetLabelsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetLabelsAsync(request.Project, request.Resource, request.GlobalSetLabelsRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void TestIamPermissionsRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); TestIamPermissionsImageRequest request = new TestIamPermissionsImageRequest { Resource = "resource164eab96", @@ -1722,6 +838,7 @@ public void TestIamPermissionsRequestObject() public async stt::Task TestIamPermissionsRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); TestIamPermissionsImageRequest request = new TestIamPermissionsImageRequest { Resource = "resource164eab96", @@ -1748,6 +865,7 @@ public void TestIamPermissionsRequestObject() public void TestIamPermissions() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); TestIamPermissionsImageRequest request = new TestIamPermissionsImageRequest { Resource = "resource164eab96", @@ -1772,6 +890,7 @@ public void TestIamPermissions() public async stt::Task TestIamPermissionsAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); TestIamPermissionsImageRequest request = new TestIamPermissionsImageRequest { Resource = "resource164eab96", diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InstanceGroupManagersClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InstanceGroupManagersClientTest.g.cs index b755dd0591e2..667d684dc6e9 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InstanceGroupManagersClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InstanceGroupManagersClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -27,2801 +28,213 @@ namespace Google.Cloud.Compute.V1.Tests public sealed class GeneratedInstanceGroupManagersClientTest { [xunit::FactAttribute] - public void AbandonInstancesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AbandonInstancesInstanceGroupManagerRequest request = new AbandonInstancesInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagersAbandonInstancesRequestResource = new InstanceGroupManagersAbandonInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AbandonInstances(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.AbandonInstances(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AbandonInstancesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AbandonInstancesInstanceGroupManagerRequest request = new AbandonInstancesInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagersAbandonInstancesRequestResource = new InstanceGroupManagersAbandonInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AbandonInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AbandonInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AbandonInstancesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void AbandonInstances() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AbandonInstancesInstanceGroupManagerRequest request = new AbandonInstancesInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagersAbandonInstancesRequestResource = new InstanceGroupManagersAbandonInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AbandonInstances(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.AbandonInstances(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersAbandonInstancesRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AbandonInstancesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AbandonInstancesInstanceGroupManagerRequest request = new AbandonInstancesInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagersAbandonInstancesRequestResource = new InstanceGroupManagersAbandonInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AbandonInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AbandonInstancesAsync(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersAbandonInstancesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AbandonInstancesAsync(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersAbandonInstancesRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void ApplyUpdatesToInstancesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ApplyUpdatesToInstancesInstanceGroupManagerRequest request = new ApplyUpdatesToInstancesInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagersApplyUpdatesRequestResource = new InstanceGroupManagersApplyUpdatesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.ApplyUpdatesToInstances(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.ApplyUpdatesToInstances(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task ApplyUpdatesToInstancesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ApplyUpdatesToInstancesInstanceGroupManagerRequest request = new ApplyUpdatesToInstancesInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagersApplyUpdatesRequestResource = new InstanceGroupManagersApplyUpdatesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.ApplyUpdatesToInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.ApplyUpdatesToInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.ApplyUpdatesToInstancesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void ApplyUpdatesToInstances() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ApplyUpdatesToInstancesInstanceGroupManagerRequest request = new ApplyUpdatesToInstancesInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagersApplyUpdatesRequestResource = new InstanceGroupManagersApplyUpdatesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.ApplyUpdatesToInstances(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.ApplyUpdatesToInstances(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersApplyUpdatesRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task ApplyUpdatesToInstancesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ApplyUpdatesToInstancesInstanceGroupManagerRequest request = new ApplyUpdatesToInstancesInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagersApplyUpdatesRequestResource = new InstanceGroupManagersApplyUpdatesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.ApplyUpdatesToInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.ApplyUpdatesToInstancesAsync(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersApplyUpdatesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.ApplyUpdatesToInstancesAsync(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersApplyUpdatesRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void CreateInstancesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - CreateInstancesInstanceGroupManagerRequest request = new CreateInstancesInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - InstanceGroupManagersCreateInstancesRequestResource = new InstanceGroupManagersCreateInstancesRequest(), - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.CreateInstances(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.CreateInstances(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task CreateInstancesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - CreateInstancesInstanceGroupManagerRequest request = new CreateInstancesInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - InstanceGroupManagersCreateInstancesRequestResource = new InstanceGroupManagersCreateInstancesRequest(), - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.CreateInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.CreateInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.CreateInstancesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void CreateInstances() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - CreateInstancesInstanceGroupManagerRequest request = new CreateInstancesInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - InstanceGroupManagersCreateInstancesRequestResource = new InstanceGroupManagersCreateInstancesRequest(), - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.CreateInstances(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.CreateInstances(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersCreateInstancesRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task CreateInstancesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - CreateInstancesInstanceGroupManagerRequest request = new CreateInstancesInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - InstanceGroupManagersCreateInstancesRequestResource = new InstanceGroupManagersCreateInstancesRequest(), - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.CreateInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.CreateInstancesAsync(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersCreateInstancesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.CreateInstancesAsync(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersCreateInstancesRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstanceGroupManagerRequest request = new DeleteInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstanceGroupManagerRequest request = new DeleteInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstanceGroupManagerRequest request = new DeleteInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Zone, request.InstanceGroupManager); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstanceGroupManagerRequest request = new DeleteInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Zone, request.InstanceGroupManager, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Zone, request.InstanceGroupManager, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteInstancesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstancesInstanceGroupManagerRequest request = new DeleteInstancesInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - InstanceGroupManagersDeleteInstancesRequestResource = new InstanceGroupManagersDeleteInstancesRequest(), - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteInstances(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.DeleteInstances(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteInstancesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstancesInstanceGroupManagerRequest request = new DeleteInstancesInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - InstanceGroupManagersDeleteInstancesRequestResource = new InstanceGroupManagersDeleteInstancesRequest(), - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteInstancesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteInstances() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstancesInstanceGroupManagerRequest request = new DeleteInstancesInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - InstanceGroupManagersDeleteInstancesRequestResource = new InstanceGroupManagersDeleteInstancesRequest(), - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteInstances(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.DeleteInstances(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersDeleteInstancesRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteInstancesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstancesInstanceGroupManagerRequest request = new DeleteInstancesInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - InstanceGroupManagersDeleteInstancesRequestResource = new InstanceGroupManagersDeleteInstancesRequest(), - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteInstancesAsync(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersDeleteInstancesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteInstancesAsync(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersDeleteInstancesRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeletePerInstanceConfigsRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeletePerInstanceConfigsInstanceGroupManagerRequest request = new DeletePerInstanceConfigsInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagersDeletePerInstanceConfigsReqResource = new InstanceGroupManagersDeletePerInstanceConfigsReq(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeletePerInstanceConfigs(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.DeletePerInstanceConfigs(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeletePerInstanceConfigsRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeletePerInstanceConfigsInstanceGroupManagerRequest request = new DeletePerInstanceConfigsInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagersDeletePerInstanceConfigsReqResource = new InstanceGroupManagersDeletePerInstanceConfigsReq(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeletePerInstanceConfigsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeletePerInstanceConfigsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeletePerInstanceConfigsAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeletePerInstanceConfigs() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeletePerInstanceConfigsInstanceGroupManagerRequest request = new DeletePerInstanceConfigsInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagersDeletePerInstanceConfigsReqResource = new InstanceGroupManagersDeletePerInstanceConfigsReq(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeletePerInstanceConfigs(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.DeletePerInstanceConfigs(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersDeletePerInstanceConfigsReqResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeletePerInstanceConfigsAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeletePerInstanceConfigsInstanceGroupManagerRequest request = new DeletePerInstanceConfigsInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagersDeletePerInstanceConfigsReqResource = new InstanceGroupManagersDeletePerInstanceConfigsReq(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeletePerInstanceConfigsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeletePerInstanceConfigsAsync(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersDeletePerInstanceConfigsReqResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeletePerInstanceConfigsAsync(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersDeletePerInstanceConfigsReqResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetInstanceGroupManagerRequest request = new GetInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - InstanceGroupManager expectedResponse = new InstanceGroupManager - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StatefulPolicy = new StatefulPolicy(), - TargetSize = -93132225, - InstanceGroup = "instance_group6bf5a5ef", - Region = "regionedb20d96", - Versions = - { - new InstanceGroupManagerVersion(), - }, - CurrentActions = new InstanceGroupManagerActionsSummary(), - UpdatePolicy = new InstanceGroupManagerUpdatePolicy(), - Status = new InstanceGroupManagerStatus(), - Fingerprint = "fingerprint009e6052", - InstanceTemplate = "instance_template6cae3083", - TargetPools = - { - "target_pools6fc69e1f", - }, - BaseInstanceName = "base_instance_name7c1f304c", - Description = "description2cf9da67", - NamedPorts = { new NamedPort(), }, - SelfLink = "self_link7e87f12d", - AutoHealingPolicies = - { - new InstanceGroupManagerAutoHealingPolicy(), - }, - DistributionPolicy = new DistributionPolicy(), - }; - mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - InstanceGroupManager response = client.Get(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetInstanceGroupManagerRequest request = new GetInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - InstanceGroupManager expectedResponse = new InstanceGroupManager - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StatefulPolicy = new StatefulPolicy(), - TargetSize = -93132225, - InstanceGroup = "instance_group6bf5a5ef", - Region = "regionedb20d96", - Versions = - { - new InstanceGroupManagerVersion(), - }, - CurrentActions = new InstanceGroupManagerActionsSummary(), - UpdatePolicy = new InstanceGroupManagerUpdatePolicy(), - Status = new InstanceGroupManagerStatus(), - Fingerprint = "fingerprint009e6052", - InstanceTemplate = "instance_template6cae3083", - TargetPools = - { - "target_pools6fc69e1f", - }, - BaseInstanceName = "base_instance_name7c1f304c", - Description = "description2cf9da67", - NamedPorts = { new NamedPort(), }, - SelfLink = "self_link7e87f12d", - AutoHealingPolicies = - { - new InstanceGroupManagerAutoHealingPolicy(), - }, - DistributionPolicy = new DistributionPolicy(), - }; - mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - InstanceGroupManager responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - InstanceGroupManager responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Get() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetInstanceGroupManagerRequest request = new GetInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - InstanceGroupManager expectedResponse = new InstanceGroupManager - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StatefulPolicy = new StatefulPolicy(), - TargetSize = -93132225, - InstanceGroup = "instance_group6bf5a5ef", - Region = "regionedb20d96", - Versions = - { - new InstanceGroupManagerVersion(), - }, - CurrentActions = new InstanceGroupManagerActionsSummary(), - UpdatePolicy = new InstanceGroupManagerUpdatePolicy(), - Status = new InstanceGroupManagerStatus(), - Fingerprint = "fingerprint009e6052", - InstanceTemplate = "instance_template6cae3083", - TargetPools = - { - "target_pools6fc69e1f", - }, - BaseInstanceName = "base_instance_name7c1f304c", - Description = "description2cf9da67", - NamedPorts = { new NamedPort(), }, - SelfLink = "self_link7e87f12d", - AutoHealingPolicies = - { - new InstanceGroupManagerAutoHealingPolicy(), - }, - DistributionPolicy = new DistributionPolicy(), - }; - mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - InstanceGroupManager response = client.Get(request.Project, request.Zone, request.InstanceGroupManager); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetInstanceGroupManagerRequest request = new GetInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - InstanceGroupManager expectedResponse = new InstanceGroupManager - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StatefulPolicy = new StatefulPolicy(), - TargetSize = -93132225, - InstanceGroup = "instance_group6bf5a5ef", - Region = "regionedb20d96", - Versions = - { - new InstanceGroupManagerVersion(), - }, - CurrentActions = new InstanceGroupManagerActionsSummary(), - UpdatePolicy = new InstanceGroupManagerUpdatePolicy(), - Status = new InstanceGroupManagerStatus(), - Fingerprint = "fingerprint009e6052", - InstanceTemplate = "instance_template6cae3083", - TargetPools = - { - "target_pools6fc69e1f", - }, - BaseInstanceName = "base_instance_name7c1f304c", - Description = "description2cf9da67", - NamedPorts = { new NamedPort(), }, - SelfLink = "self_link7e87f12d", - AutoHealingPolicies = - { - new InstanceGroupManagerAutoHealingPolicy(), - }, - DistributionPolicy = new DistributionPolicy(), - }; - mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - InstanceGroupManager responseCallSettings = await client.GetAsync(request.Project, request.Zone, request.InstanceGroupManager, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - InstanceGroupManager responseCancellationToken = await client.GetAsync(request.Project, request.Zone, request.InstanceGroupManager, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInstanceGroupManagerRequest request = new InsertInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceGroupManagerResource = new InstanceGroupManager(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInstanceGroupManagerRequest request = new InsertInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceGroupManagerResource = new InstanceGroupManager(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInstanceGroupManagerRequest request = new InsertInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManagerResource = new InstanceGroupManager(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Zone, request.InstanceGroupManagerResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInstanceGroupManagerRequest request = new InsertInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManagerResource = new InstanceGroupManager(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Zone, request.InstanceGroupManagerResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Zone, request.InstanceGroupManagerResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchInstanceGroupManagerRequest request = new PatchInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagerResource = new InstanceGroupManager(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchInstanceGroupManagerRequest request = new PatchInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagerResource = new InstanceGroupManager(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchInstanceGroupManagerRequest request = new PatchInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagerResource = new InstanceGroupManager(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagerResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchInstanceGroupManagerRequest request = new PatchInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagerResource = new InstanceGroupManager(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagerResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagerResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchPerInstanceConfigsRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchPerInstanceConfigsInstanceGroupManagerRequest request = new PatchPerInstanceConfigsInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagersPatchPerInstanceConfigsReqResource = new InstanceGroupManagersPatchPerInstanceConfigsReq(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchPerInstanceConfigs(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.PatchPerInstanceConfigs(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchPerInstanceConfigsRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchPerInstanceConfigsInstanceGroupManagerRequest request = new PatchPerInstanceConfigsInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagersPatchPerInstanceConfigsReqResource = new InstanceGroupManagersPatchPerInstanceConfigsReq(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchPerInstanceConfigsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchPerInstanceConfigsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchPerInstanceConfigsAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchPerInstanceConfigs() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchPerInstanceConfigsInstanceGroupManagerRequest request = new PatchPerInstanceConfigsInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagersPatchPerInstanceConfigsReqResource = new InstanceGroupManagersPatchPerInstanceConfigsReq(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchPerInstanceConfigs(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.PatchPerInstanceConfigs(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersPatchPerInstanceConfigsReqResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchPerInstanceConfigsAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchPerInstanceConfigsInstanceGroupManagerRequest request = new PatchPerInstanceConfigsInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagersPatchPerInstanceConfigsReqResource = new InstanceGroupManagersPatchPerInstanceConfigsReq(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchPerInstanceConfigsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchPerInstanceConfigsAsync(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersPatchPerInstanceConfigsReqResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchPerInstanceConfigsAsync(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersPatchPerInstanceConfigsReqResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void RecreateInstancesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RecreateInstancesInstanceGroupManagerRequest request = new RecreateInstancesInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - InstanceGroupManagersRecreateInstancesRequestResource = new InstanceGroupManagersRecreateInstancesRequest(), - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RecreateInstances(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.RecreateInstances(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task RecreateInstancesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RecreateInstancesInstanceGroupManagerRequest request = new RecreateInstancesInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - InstanceGroupManagersRecreateInstancesRequestResource = new InstanceGroupManagersRecreateInstancesRequest(), - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RecreateInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RecreateInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RecreateInstancesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void RecreateInstances() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RecreateInstancesInstanceGroupManagerRequest request = new RecreateInstancesInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - InstanceGroupManagersRecreateInstancesRequestResource = new InstanceGroupManagersRecreateInstancesRequest(), - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RecreateInstances(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.RecreateInstances(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersRecreateInstancesRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task RecreateInstancesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RecreateInstancesInstanceGroupManagerRequest request = new RecreateInstancesInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - InstanceGroupManagersRecreateInstancesRequestResource = new InstanceGroupManagersRecreateInstancesRequest(), - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RecreateInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RecreateInstancesAsync(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersRecreateInstancesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RecreateInstancesAsync(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersRecreateInstancesRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void ResizeRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResizeInstanceGroupManagerRequest request = new ResizeInstanceGroupManagerRequest - { - Size = -1218396681, - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Resize(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Resize(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task ResizeRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResizeInstanceGroupManagerRequest request = new ResizeInstanceGroupManagerRequest - { - Size = -1218396681, - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.ResizeAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.ResizeAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.ResizeAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Resize() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResizeInstanceGroupManagerRequest request = new ResizeInstanceGroupManagerRequest - { - Size = -1218396681, - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Resize(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Resize(request.Project, request.Zone, request.InstanceGroupManager, request.Size); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task ResizeAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResizeInstanceGroupManagerRequest request = new ResizeInstanceGroupManagerRequest - { - Size = -1218396681, - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.ResizeAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.ResizeAsync(request.Project, request.Zone, request.InstanceGroupManager, request.Size, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.ResizeAsync(request.Project, request.Zone, request.InstanceGroupManager, request.Size, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetInstanceTemplateRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetInstanceTemplateInstanceGroupManagerRequest request = new SetInstanceTemplateInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - InstanceGroupManagersSetInstanceTemplateRequestResource = new InstanceGroupManagersSetInstanceTemplateRequest(), - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetInstanceTemplate(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetInstanceTemplate(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetInstanceTemplateRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetInstanceTemplateInstanceGroupManagerRequest request = new SetInstanceTemplateInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - InstanceGroupManagersSetInstanceTemplateRequestResource = new InstanceGroupManagersSetInstanceTemplateRequest(), - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetInstanceTemplateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetInstanceTemplateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetInstanceTemplateAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetInstanceTemplate() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetInstanceTemplateInstanceGroupManagerRequest request = new SetInstanceTemplateInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - InstanceGroupManagersSetInstanceTemplateRequestResource = new InstanceGroupManagersSetInstanceTemplateRequest(), - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetInstanceTemplate(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetInstanceTemplate(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersSetInstanceTemplateRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetInstanceTemplateAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetInstanceTemplateInstanceGroupManagerRequest request = new SetInstanceTemplateInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - InstanceGroupManagersSetInstanceTemplateRequestResource = new InstanceGroupManagersSetInstanceTemplateRequest(), - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetInstanceTemplateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetInstanceTemplateAsync(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersSetInstanceTemplateRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetInstanceTemplateAsync(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersSetInstanceTemplateRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetTargetPoolsRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetTargetPoolsInstanceGroupManagerRequest request = new SetTargetPoolsInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagersSetTargetPoolsRequestResource = new InstanceGroupManagersSetTargetPoolsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetTargetPools(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetTargetPools(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetTargetPoolsRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetTargetPoolsInstanceGroupManagerRequest request = new SetTargetPoolsInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagersSetTargetPoolsRequestResource = new InstanceGroupManagersSetTargetPoolsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetTargetPoolsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetTargetPoolsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetTargetPoolsAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetTargetPools() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetTargetPoolsInstanceGroupManagerRequest request = new SetTargetPoolsInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagersSetTargetPoolsRequestResource = new InstanceGroupManagersSetTargetPoolsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetTargetPools(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetTargetPools(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersSetTargetPoolsRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetTargetPoolsAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetTargetPoolsInstanceGroupManagerRequest request = new SetTargetPoolsInstanceGroupManagerRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagersSetTargetPoolsRequestResource = new InstanceGroupManagersSetTargetPoolsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetTargetPoolsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetTargetPoolsAsync(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersSetTargetPoolsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetTargetPoolsAsync(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersSetTargetPoolsRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void UpdatePerInstanceConfigsRequestObject() + public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdatePerInstanceConfigsInstanceGroupManagerRequest request = new UpdatePerInstanceConfigsInstanceGroupManagerRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetInstanceGroupManagerRequest request = new GetInstanceGroupManagerRequest { Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - InstanceGroupManagersUpdatePerInstanceConfigsReqResource = new InstanceGroupManagersUpdatePerInstanceConfigsReq(), Project = "projectaa6ff846", InstanceGroupManager = "instance_group_manager71b45dfc", }; - Operation expectedResponse = new Operation + InstanceGroupManager expectedResponse = new InstanceGroupManager { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", Zone = "zone255f4ea8", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + StatefulPolicy = new StatefulPolicy(), + TargetSize = -93132225, + InstanceGroup = "instance_group6bf5a5ef", Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Versions = + { + new InstanceGroupManagerVersion(), + }, + CurrentActions = new InstanceGroupManagerActionsSummary(), + UpdatePolicy = new InstanceGroupManagerUpdatePolicy(), + Status = new InstanceGroupManagerStatus(), + Fingerprint = "fingerprint009e6052", + InstanceTemplate = "instance_template6cae3083", + TargetPools = + { + "target_pools6fc69e1f", + }, + BaseInstanceName = "base_instance_name7c1f304c", Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + NamedPorts = { new NamedPort(), }, SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + AutoHealingPolicies = + { + new InstanceGroupManagerAutoHealingPolicy(), + }, + DistributionPolicy = new DistributionPolicy(), }; - mockGrpcClient.Setup(x => x.UpdatePerInstanceConfigs(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.UpdatePerInstanceConfigs(request); + InstanceGroupManager response = client.Get(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task UpdatePerInstanceConfigsRequestObjectAsync() + public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdatePerInstanceConfigsInstanceGroupManagerRequest request = new UpdatePerInstanceConfigsInstanceGroupManagerRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetInstanceGroupManagerRequest request = new GetInstanceGroupManagerRequest { Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - InstanceGroupManagersUpdatePerInstanceConfigsReqResource = new InstanceGroupManagersUpdatePerInstanceConfigsReq(), Project = "projectaa6ff846", InstanceGroupManager = "instance_group_manager71b45dfc", }; - Operation expectedResponse = new Operation + InstanceGroupManager expectedResponse = new InstanceGroupManager { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", Zone = "zone255f4ea8", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + StatefulPolicy = new StatefulPolicy(), + TargetSize = -93132225, + InstanceGroup = "instance_group6bf5a5ef", Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Versions = + { + new InstanceGroupManagerVersion(), + }, + CurrentActions = new InstanceGroupManagerActionsSummary(), + UpdatePolicy = new InstanceGroupManagerUpdatePolicy(), + Status = new InstanceGroupManagerStatus(), + Fingerprint = "fingerprint009e6052", + InstanceTemplate = "instance_template6cae3083", + TargetPools = + { + "target_pools6fc69e1f", + }, + BaseInstanceName = "base_instance_name7c1f304c", Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + NamedPorts = { new NamedPort(), }, SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + AutoHealingPolicies = + { + new InstanceGroupManagerAutoHealingPolicy(), + }, + DistributionPolicy = new DistributionPolicy(), }; - mockGrpcClient.Setup(x => x.UpdatePerInstanceConfigsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdatePerInstanceConfigsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + InstanceGroupManager responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdatePerInstanceConfigsAsync(request, st::CancellationToken.None); + InstanceGroupManager responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void UpdatePerInstanceConfigs() + public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdatePerInstanceConfigsInstanceGroupManagerRequest request = new UpdatePerInstanceConfigsInstanceGroupManagerRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetInstanceGroupManagerRequest request = new GetInstanceGroupManagerRequest { Zone = "zone255f4ea8", - InstanceGroupManagersUpdatePerInstanceConfigsReqResource = new InstanceGroupManagersUpdatePerInstanceConfigsReq(), Project = "projectaa6ff846", InstanceGroupManager = "instance_group_manager71b45dfc", }; - Operation expectedResponse = new Operation + InstanceGroupManager expectedResponse = new InstanceGroupManager { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", Zone = "zone255f4ea8", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + StatefulPolicy = new StatefulPolicy(), + TargetSize = -93132225, + InstanceGroup = "instance_group6bf5a5ef", Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Versions = + { + new InstanceGroupManagerVersion(), + }, + CurrentActions = new InstanceGroupManagerActionsSummary(), + UpdatePolicy = new InstanceGroupManagerUpdatePolicy(), + Status = new InstanceGroupManagerStatus(), + Fingerprint = "fingerprint009e6052", + InstanceTemplate = "instance_template6cae3083", + TargetPools = + { + "target_pools6fc69e1f", + }, + BaseInstanceName = "base_instance_name7c1f304c", Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + NamedPorts = { new NamedPort(), }, SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + AutoHealingPolicies = + { + new InstanceGroupManagerAutoHealingPolicy(), + }, + DistributionPolicy = new DistributionPolicy(), }; - mockGrpcClient.Setup(x => x.UpdatePerInstanceConfigs(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.UpdatePerInstanceConfigs(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersUpdatePerInstanceConfigsReqResource); + InstanceGroupManager response = client.Get(request.Project, request.Zone, request.InstanceGroupManager); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task UpdatePerInstanceConfigsAsync() + public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdatePerInstanceConfigsInstanceGroupManagerRequest request = new UpdatePerInstanceConfigsInstanceGroupManagerRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetInstanceGroupManagerRequest request = new GetInstanceGroupManagerRequest { Zone = "zone255f4ea8", - InstanceGroupManagersUpdatePerInstanceConfigsReqResource = new InstanceGroupManagersUpdatePerInstanceConfigsReq(), Project = "projectaa6ff846", InstanceGroupManager = "instance_group_manager71b45dfc", }; - Operation expectedResponse = new Operation + InstanceGroupManager expectedResponse = new InstanceGroupManager { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", Zone = "zone255f4ea8", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + StatefulPolicy = new StatefulPolicy(), + TargetSize = -93132225, + InstanceGroup = "instance_group6bf5a5ef", Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Versions = + { + new InstanceGroupManagerVersion(), + }, + CurrentActions = new InstanceGroupManagerActionsSummary(), + UpdatePolicy = new InstanceGroupManagerUpdatePolicy(), + Status = new InstanceGroupManagerStatus(), + Fingerprint = "fingerprint009e6052", + InstanceTemplate = "instance_template6cae3083", + TargetPools = + { + "target_pools6fc69e1f", + }, + BaseInstanceName = "base_instance_name7c1f304c", Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + NamedPorts = { new NamedPort(), }, SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + AutoHealingPolicies = + { + new InstanceGroupManagerAutoHealingPolicy(), + }, + DistributionPolicy = new DistributionPolicy(), }; - mockGrpcClient.Setup(x => x.UpdatePerInstanceConfigsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); InstanceGroupManagersClient client = new InstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdatePerInstanceConfigsAsync(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersUpdatePerInstanceConfigsReqResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + InstanceGroupManager responseCallSettings = await client.GetAsync(request.Project, request.Zone, request.InstanceGroupManager, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdatePerInstanceConfigsAsync(request.Project, request.Zone, request.InstanceGroupManager, request.InstanceGroupManagersUpdatePerInstanceConfigsReqResource, st::CancellationToken.None); + InstanceGroupManager responseCancellationToken = await client.GetAsync(request.Project, request.Zone, request.InstanceGroupManager, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InstanceGroupsClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InstanceGroupsClientTest.g.cs index ea6b4b746474..5b2aebc74c8a 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InstanceGroupsClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InstanceGroupsClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,378 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedInstanceGroupsClientTest { - [xunit::FactAttribute] - public void AddInstancesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddInstancesInstanceGroupRequest request = new AddInstancesInstanceGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - InstanceGroup = "instance_group6bf5a5ef", - Project = "projectaa6ff846", - InstanceGroupsAddInstancesRequestResource = new InstanceGroupsAddInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddInstances(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupsClient client = new InstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddInstances(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddInstancesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddInstancesInstanceGroupRequest request = new AddInstancesInstanceGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - InstanceGroup = "instance_group6bf5a5ef", - Project = "projectaa6ff846", - InstanceGroupsAddInstancesRequestResource = new InstanceGroupsAddInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupsClient client = new InstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddInstancesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void AddInstances() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddInstancesInstanceGroupRequest request = new AddInstancesInstanceGroupRequest - { - Zone = "zone255f4ea8", - InstanceGroup = "instance_group6bf5a5ef", - Project = "projectaa6ff846", - InstanceGroupsAddInstancesRequestResource = new InstanceGroupsAddInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddInstances(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupsClient client = new InstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddInstances(request.Project, request.Zone, request.InstanceGroup, request.InstanceGroupsAddInstancesRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddInstancesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddInstancesInstanceGroupRequest request = new AddInstancesInstanceGroupRequest - { - Zone = "zone255f4ea8", - InstanceGroup = "instance_group6bf5a5ef", - Project = "projectaa6ff846", - InstanceGroupsAddInstancesRequestResource = new InstanceGroupsAddInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupsClient client = new InstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddInstancesAsync(request.Project, request.Zone, request.InstanceGroup, request.InstanceGroupsAddInstancesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddInstancesAsync(request.Project, request.Zone, request.InstanceGroup, request.InstanceGroupsAddInstancesRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstanceGroupRequest request = new DeleteInstanceGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - InstanceGroup = "instance_group6bf5a5ef", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupsClient client = new InstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstanceGroupRequest request = new DeleteInstanceGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - InstanceGroup = "instance_group6bf5a5ef", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupsClient client = new InstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstanceGroupRequest request = new DeleteInstanceGroupRequest - { - Zone = "zone255f4ea8", - InstanceGroup = "instance_group6bf5a5ef", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupsClient client = new InstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Zone, request.InstanceGroup); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstanceGroupRequest request = new DeleteInstanceGroupRequest - { - Zone = "zone255f4ea8", - InstanceGroup = "instance_group6bf5a5ef", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupsClient client = new InstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Zone, request.InstanceGroup, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Zone, request.InstanceGroup, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetInstanceGroupRequest request = new GetInstanceGroupRequest { Zone = "zone255f4ea8", @@ -431,6 +65,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetInstanceGroupRequest request = new GetInstanceGroupRequest { Zone = "zone255f4ea8", @@ -466,6 +101,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetInstanceGroupRequest request = new GetInstanceGroupRequest { Zone = "zone255f4ea8", @@ -499,6 +135,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetInstanceGroupRequest request = new GetInstanceGroupRequest { Zone = "zone255f4ea8", @@ -529,559 +166,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInstanceGroupRequest request = new InsertInstanceGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceGroupResource = new InstanceGroup(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupsClient client = new InstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInstanceGroupRequest request = new InsertInstanceGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceGroupResource = new InstanceGroup(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupsClient client = new InstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInstanceGroupRequest request = new InsertInstanceGroupRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupResource = new InstanceGroup(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupsClient client = new InstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Zone, request.InstanceGroupResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInstanceGroupRequest request = new InsertInstanceGroupRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - InstanceGroupResource = new InstanceGroup(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupsClient client = new InstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Zone, request.InstanceGroupResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Zone, request.InstanceGroupResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void RemoveInstancesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveInstancesInstanceGroupRequest request = new RemoveInstancesInstanceGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - InstanceGroup = "instance_group6bf5a5ef", - Project = "projectaa6ff846", - InstanceGroupsRemoveInstancesRequestResource = new InstanceGroupsRemoveInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveInstances(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupsClient client = new InstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.RemoveInstances(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task RemoveInstancesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveInstancesInstanceGroupRequest request = new RemoveInstancesInstanceGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - InstanceGroup = "instance_group6bf5a5ef", - Project = "projectaa6ff846", - InstanceGroupsRemoveInstancesRequestResource = new InstanceGroupsRemoveInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupsClient client = new InstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RemoveInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RemoveInstancesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void RemoveInstances() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveInstancesInstanceGroupRequest request = new RemoveInstancesInstanceGroupRequest - { - Zone = "zone255f4ea8", - InstanceGroup = "instance_group6bf5a5ef", - Project = "projectaa6ff846", - InstanceGroupsRemoveInstancesRequestResource = new InstanceGroupsRemoveInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveInstances(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupsClient client = new InstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.RemoveInstances(request.Project, request.Zone, request.InstanceGroup, request.InstanceGroupsRemoveInstancesRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task RemoveInstancesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveInstancesInstanceGroupRequest request = new RemoveInstancesInstanceGroupRequest - { - Zone = "zone255f4ea8", - InstanceGroup = "instance_group6bf5a5ef", - Project = "projectaa6ff846", - InstanceGroupsRemoveInstancesRequestResource = new InstanceGroupsRemoveInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupsClient client = new InstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RemoveInstancesAsync(request.Project, request.Zone, request.InstanceGroup, request.InstanceGroupsRemoveInstancesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RemoveInstancesAsync(request.Project, request.Zone, request.InstanceGroup, request.InstanceGroupsRemoveInstancesRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetNamedPortsRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetNamedPortsInstanceGroupRequest request = new SetNamedPortsInstanceGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - InstanceGroup = "instance_group6bf5a5ef", - Project = "projectaa6ff846", - InstanceGroupsSetNamedPortsRequestResource = new InstanceGroupsSetNamedPortsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetNamedPorts(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupsClient client = new InstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetNamedPorts(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetNamedPortsRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetNamedPortsInstanceGroupRequest request = new SetNamedPortsInstanceGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - InstanceGroup = "instance_group6bf5a5ef", - Project = "projectaa6ff846", - InstanceGroupsSetNamedPortsRequestResource = new InstanceGroupsSetNamedPortsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetNamedPortsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupsClient client = new InstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetNamedPortsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetNamedPortsAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetNamedPorts() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetNamedPortsInstanceGroupRequest request = new SetNamedPortsInstanceGroupRequest - { - Zone = "zone255f4ea8", - InstanceGroup = "instance_group6bf5a5ef", - Project = "projectaa6ff846", - InstanceGroupsSetNamedPortsRequestResource = new InstanceGroupsSetNamedPortsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetNamedPorts(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceGroupsClient client = new InstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetNamedPorts(request.Project, request.Zone, request.InstanceGroup, request.InstanceGroupsSetNamedPortsRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetNamedPortsAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetNamedPortsInstanceGroupRequest request = new SetNamedPortsInstanceGroupRequest - { - Zone = "zone255f4ea8", - InstanceGroup = "instance_group6bf5a5ef", - Project = "projectaa6ff846", - InstanceGroupsSetNamedPortsRequestResource = new InstanceGroupsSetNamedPortsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetNamedPortsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceGroupsClient client = new InstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetNamedPortsAsync(request.Project, request.Zone, request.InstanceGroup, request.InstanceGroupsSetNamedPortsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetNamedPortsAsync(request.Project, request.Zone, request.InstanceGroup, request.InstanceGroupsSetNamedPortsRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InstanceTemplatesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InstanceTemplatesClientTest.g.cs index b2e4247fa6f4..d6956623d282 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InstanceTemplatesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InstanceTemplatesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,188 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedInstanceTemplatesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstanceTemplateRequest request = new DeleteInstanceTemplateRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceTemplate = "instance_template6cae3083", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceTemplatesClient client = new InstanceTemplatesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstanceTemplateRequest request = new DeleteInstanceTemplateRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceTemplate = "instance_template6cae3083", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceTemplatesClient client = new InstanceTemplatesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstanceTemplateRequest request = new DeleteInstanceTemplateRequest - { - Project = "projectaa6ff846", - InstanceTemplate = "instance_template6cae3083", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceTemplatesClient client = new InstanceTemplatesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.InstanceTemplate); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstanceTemplateRequest request = new DeleteInstanceTemplateRequest - { - Project = "projectaa6ff846", - InstanceTemplate = "instance_template6cae3083", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceTemplatesClient client = new InstanceTemplatesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.InstanceTemplate, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.InstanceTemplate, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetInstanceTemplateRequest request = new GetInstanceTemplateRequest { Project = "projectaa6ff846", @@ -236,6 +60,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetInstanceTemplateRequest request = new GetInstanceTemplateRequest { Project = "projectaa6ff846", @@ -266,6 +91,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetInstanceTemplateRequest request = new GetInstanceTemplateRequest { Project = "projectaa6ff846", @@ -294,6 +120,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetInstanceTemplateRequest request = new GetInstanceTemplateRequest { Project = "projectaa6ff846", @@ -324,6 +151,7 @@ public void Get() public void GetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetIamPolicyInstanceTemplateRequest request = new GetIamPolicyInstanceTemplateRequest { Resource = "resource164eab96", @@ -350,6 +178,7 @@ public void GetIamPolicyRequestObject() public async stt::Task GetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetIamPolicyInstanceTemplateRequest request = new GetIamPolicyInstanceTemplateRequest { Resource = "resource164eab96", @@ -378,6 +207,7 @@ public void GetIamPolicyRequestObject() public void GetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetIamPolicyInstanceTemplateRequest request = new GetIamPolicyInstanceTemplateRequest { Resource = "resource164eab96", @@ -403,6 +233,7 @@ public void GetIamPolicy() public async stt::Task GetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetIamPolicyInstanceTemplateRequest request = new GetIamPolicyInstanceTemplateRequest { Resource = "resource164eab96", @@ -426,188 +257,11 @@ public void GetIamPolicy() mockGrpcClient.VerifyAll(); } - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInstanceTemplateRequest request = new InsertInstanceTemplateRequest - { - InstanceTemplateResource = new InstanceTemplate(), - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceTemplatesClient client = new InstanceTemplatesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInstanceTemplateRequest request = new InsertInstanceTemplateRequest - { - InstanceTemplateResource = new InstanceTemplate(), - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceTemplatesClient client = new InstanceTemplatesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInstanceTemplateRequest request = new InsertInstanceTemplateRequest - { - InstanceTemplateResource = new InstanceTemplate(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - InstanceTemplatesClient client = new InstanceTemplatesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.InstanceTemplateResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInstanceTemplateRequest request = new InsertInstanceTemplateRequest - { - InstanceTemplateResource = new InstanceTemplate(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstanceTemplatesClient client = new InstanceTemplatesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.InstanceTemplateResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.InstanceTemplateResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void SetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); SetIamPolicyInstanceTemplateRequest request = new SetIamPolicyInstanceTemplateRequest { Resource = "resource164eab96", @@ -634,6 +288,7 @@ public void SetIamPolicyRequestObject() public async stt::Task SetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); SetIamPolicyInstanceTemplateRequest request = new SetIamPolicyInstanceTemplateRequest { Resource = "resource164eab96", @@ -662,6 +317,7 @@ public void SetIamPolicyRequestObject() public void SetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); SetIamPolicyInstanceTemplateRequest request = new SetIamPolicyInstanceTemplateRequest { Resource = "resource164eab96", @@ -688,6 +344,7 @@ public void SetIamPolicy() public async stt::Task SetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); SetIamPolicyInstanceTemplateRequest request = new SetIamPolicyInstanceTemplateRequest { Resource = "resource164eab96", @@ -716,6 +373,7 @@ public void SetIamPolicy() public void TestIamPermissionsRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); TestIamPermissionsInstanceTemplateRequest request = new TestIamPermissionsInstanceTemplateRequest { Resource = "resource164eab96", @@ -740,6 +398,7 @@ public void TestIamPermissionsRequestObject() public async stt::Task TestIamPermissionsRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); TestIamPermissionsInstanceTemplateRequest request = new TestIamPermissionsInstanceTemplateRequest { Resource = "resource164eab96", @@ -766,6 +425,7 @@ public void TestIamPermissionsRequestObject() public void TestIamPermissions() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); TestIamPermissionsInstanceTemplateRequest request = new TestIamPermissionsInstanceTemplateRequest { Resource = "resource164eab96", @@ -790,6 +450,7 @@ public void TestIamPermissions() public async stt::Task TestIamPermissionsAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); TestIamPermissionsInstanceTemplateRequest request = new TestIamPermissionsInstanceTemplateRequest { Resource = "resource164eab96", diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InstancesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InstancesClientTest.g.cs index 944dbbd334ce..570c514b36c8 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InstancesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InstancesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -27,6727 +28,1187 @@ namespace Google.Cloud.Compute.V1.Tests public sealed class GeneratedInstancesClientTest { [xunit::FactAttribute] - public void AddAccessConfigRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddAccessConfigInstanceRequest request = new AddAccessConfigInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - NetworkInterface = "network_interfaceb50da44f", - AccessConfigResource = new AccessConfig(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddAccessConfig(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddAccessConfig(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddAccessConfigRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddAccessConfigInstanceRequest request = new AddAccessConfigInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - NetworkInterface = "network_interfaceb50da44f", - AccessConfigResource = new AccessConfig(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddAccessConfigAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddAccessConfigAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddAccessConfigAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void AddAccessConfig() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddAccessConfigInstanceRequest request = new AddAccessConfigInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - NetworkInterface = "network_interfaceb50da44f", - AccessConfigResource = new AccessConfig(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddAccessConfig(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddAccessConfig(request.Project, request.Zone, request.Instance, request.NetworkInterface, request.AccessConfigResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddAccessConfigAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddAccessConfigInstanceRequest request = new AddAccessConfigInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - NetworkInterface = "network_interfaceb50da44f", - AccessConfigResource = new AccessConfig(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddAccessConfigAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddAccessConfigAsync(request.Project, request.Zone, request.Instance, request.NetworkInterface, request.AccessConfigResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddAccessConfigAsync(request.Project, request.Zone, request.Instance, request.NetworkInterface, request.AccessConfigResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void AddResourcePoliciesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddResourcePoliciesInstanceRequest request = new AddResourcePoliciesInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstancesAddResourcePoliciesRequestResource = new InstancesAddResourcePoliciesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddResourcePolicies(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddResourcePolicies(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddResourcePoliciesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddResourcePoliciesInstanceRequest request = new AddResourcePoliciesInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstancesAddResourcePoliciesRequestResource = new InstancesAddResourcePoliciesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddResourcePoliciesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddResourcePoliciesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddResourcePoliciesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void AddResourcePolicies() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddResourcePoliciesInstanceRequest request = new AddResourcePoliciesInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - InstancesAddResourcePoliciesRequestResource = new InstancesAddResourcePoliciesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddResourcePolicies(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddResourcePolicies(request.Project, request.Zone, request.Instance, request.InstancesAddResourcePoliciesRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddResourcePoliciesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddResourcePoliciesInstanceRequest request = new AddResourcePoliciesInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - InstancesAddResourcePoliciesRequestResource = new InstancesAddResourcePoliciesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddResourcePoliciesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddResourcePoliciesAsync(request.Project, request.Zone, request.Instance, request.InstancesAddResourcePoliciesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddResourcePoliciesAsync(request.Project, request.Zone, request.Instance, request.InstancesAddResourcePoliciesRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void AttachDiskRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AttachDiskInstanceRequest request = new AttachDiskInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - AttachedDiskResource = new AttachedDisk(), - ForceAttach = false, - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AttachDisk(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.AttachDisk(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AttachDiskRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AttachDiskInstanceRequest request = new AttachDiskInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - AttachedDiskResource = new AttachedDisk(), - ForceAttach = false, - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AttachDiskAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AttachDiskAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AttachDiskAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void AttachDisk() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AttachDiskInstanceRequest request = new AttachDiskInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - AttachedDiskResource = new AttachedDisk(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AttachDisk(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.AttachDisk(request.Project, request.Zone, request.Instance, request.AttachedDiskResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AttachDiskAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AttachDiskInstanceRequest request = new AttachDiskInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - AttachedDiskResource = new AttachedDisk(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AttachDiskAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AttachDiskAsync(request.Project, request.Zone, request.Instance, request.AttachedDiskResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AttachDiskAsync(request.Project, request.Zone, request.Instance, request.AttachedDiskResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void BulkInsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - BulkInsertInstanceRequest request = new BulkInsertInstanceRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - BulkInsertInstanceResourceResource = new BulkInsertInstanceResource(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.BulkInsert(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.BulkInsert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task BulkInsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - BulkInsertInstanceRequest request = new BulkInsertInstanceRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - BulkInsertInstanceResourceResource = new BulkInsertInstanceResource(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.BulkInsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.BulkInsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.BulkInsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void BulkInsert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - BulkInsertInstanceRequest request = new BulkInsertInstanceRequest - { - Zone = "zone255f4ea8", - BulkInsertInstanceResourceResource = new BulkInsertInstanceResource(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.BulkInsert(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.BulkInsert(request.Project, request.Zone, request.BulkInsertInstanceResourceResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task BulkInsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - BulkInsertInstanceRequest request = new BulkInsertInstanceRequest - { - Zone = "zone255f4ea8", - BulkInsertInstanceResourceResource = new BulkInsertInstanceResource(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.BulkInsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.BulkInsertAsync(request.Project, request.Zone, request.BulkInsertInstanceResourceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.BulkInsertAsync(request.Project, request.Zone, request.BulkInsertInstanceResourceResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstanceRequest request = new DeleteInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstanceRequest request = new DeleteInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstanceRequest request = new DeleteInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Zone, request.Instance); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstanceRequest request = new DeleteInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Zone, request.Instance, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Zone, request.Instance, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteAccessConfigRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteAccessConfigInstanceRequest request = new DeleteAccessConfigInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - AccessConfig = "access_config9ac9e082", - Project = "projectaa6ff846", - NetworkInterface = "network_interfaceb50da44f", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAccessConfig(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.DeleteAccessConfig(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAccessConfigRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteAccessConfigInstanceRequest request = new DeleteAccessConfigInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - AccessConfig = "access_config9ac9e082", - Project = "projectaa6ff846", - NetworkInterface = "network_interfaceb50da44f", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAccessConfigAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAccessConfigAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAccessConfigAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteAccessConfig() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteAccessConfigInstanceRequest request = new DeleteAccessConfigInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - AccessConfig = "access_config9ac9e082", - Project = "projectaa6ff846", - NetworkInterface = "network_interfaceb50da44f", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAccessConfig(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.DeleteAccessConfig(request.Project, request.Zone, request.Instance, request.AccessConfig, request.NetworkInterface); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAccessConfigAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteAccessConfigInstanceRequest request = new DeleteAccessConfigInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - AccessConfig = "access_config9ac9e082", - Project = "projectaa6ff846", - NetworkInterface = "network_interfaceb50da44f", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAccessConfigAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAccessConfigAsync(request.Project, request.Zone, request.Instance, request.AccessConfig, request.NetworkInterface, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAccessConfigAsync(request.Project, request.Zone, request.Instance, request.AccessConfig, request.NetworkInterface, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DetachDiskRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DetachDiskInstanceRequest request = new DetachDiskInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - DeviceName = "device_name41d7923b", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DetachDisk(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.DetachDisk(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DetachDiskRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DetachDiskInstanceRequest request = new DetachDiskInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - DeviceName = "device_name41d7923b", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DetachDiskAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DetachDiskAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DetachDiskAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DetachDisk() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DetachDiskInstanceRequest request = new DetachDiskInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - DeviceName = "device_name41d7923b", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DetachDisk(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.DetachDisk(request.Project, request.Zone, request.Instance, request.DeviceName); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DetachDiskAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DetachDiskInstanceRequest request = new DetachDiskInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - DeviceName = "device_name41d7923b", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DetachDiskAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DetachDiskAsync(request.Project, request.Zone, request.Instance, request.DeviceName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DetachDiskAsync(request.Project, request.Zone, request.Instance, request.DeviceName, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetInstanceRequest request = new GetInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - Instance expectedResponse = new Instance - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Tags = new Tags(), - Zone = "zone255f4ea8", - ShieldedInstanceConfig = new ShieldedInstanceConfig(), - ResourcePolicies = - { - "resource_policiesdff15734", - }, - CreationTimestamp = "creation_timestamp235e59a1", - PrivateIpv6GoogleAccess = Instance.Types.PrivateIpv6GoogleAccess.InheritFromSubnetwork, - NetworkInterfaces = - { - new NetworkInterface(), - }, - Metadata = new Metadata(), - Disks = { new AttachedDisk(), }, - StartRestricted = true, - ReservationAffinity = new ReservationAffinity(), - ShieldedInstanceIntegrityPolicy = new ShieldedInstanceIntegrityPolicy(), - LabelFingerprint = "label_fingerprint06ccff3a", - Status = Instance.Types.Status.Provisioning, - MachineType = "machine_type68ce40fa", - Fingerprint = "fingerprint009e6052", - Hostname = "hostnamef4ac9708", - MinCpuPlatform = "min_cpu_platformf71ffa67", - DisplayDevice = new DisplayDevice(), - ServiceAccounts = - { - new ServiceAccount(), - }, - StatusMessage = "status_message2c618f86", - LastSuspendedTimestamp = "last_suspended_timestamp1e59392b", - Scheduling = new Scheduling(), - AdvancedMachineFeatures = new AdvancedMachineFeatures(), - CpuPlatform = "cpu_platformd5794042", - LastStopTimestamp = "last_stop_timestampd336a8f1", - Description = "description2cf9da67", - LastStartTimestamp = "last_start_timestampe26bd347", - SelfLink = "self_link7e87f12d", - DeletionProtection = false, - GuestAccelerators = - { - new AcceleratorConfig(), - }, - CanIpForward = true, - SatisfiesPzs = false, - ConfidentialInstanceConfig = new ConfidentialInstanceConfig(), - Labels = - { - { - "key8a0b6e3c", - "value60c16320" - }, - }, - }; - mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Instance response = client.Get(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetInstanceRequest request = new GetInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - Instance expectedResponse = new Instance - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Tags = new Tags(), - Zone = "zone255f4ea8", - ShieldedInstanceConfig = new ShieldedInstanceConfig(), - ResourcePolicies = - { - "resource_policiesdff15734", - }, - CreationTimestamp = "creation_timestamp235e59a1", - PrivateIpv6GoogleAccess = Instance.Types.PrivateIpv6GoogleAccess.InheritFromSubnetwork, - NetworkInterfaces = - { - new NetworkInterface(), - }, - Metadata = new Metadata(), - Disks = { new AttachedDisk(), }, - StartRestricted = true, - ReservationAffinity = new ReservationAffinity(), - ShieldedInstanceIntegrityPolicy = new ShieldedInstanceIntegrityPolicy(), - LabelFingerprint = "label_fingerprint06ccff3a", - Status = Instance.Types.Status.Provisioning, - MachineType = "machine_type68ce40fa", - Fingerprint = "fingerprint009e6052", - Hostname = "hostnamef4ac9708", - MinCpuPlatform = "min_cpu_platformf71ffa67", - DisplayDevice = new DisplayDevice(), - ServiceAccounts = - { - new ServiceAccount(), - }, - StatusMessage = "status_message2c618f86", - LastSuspendedTimestamp = "last_suspended_timestamp1e59392b", - Scheduling = new Scheduling(), - AdvancedMachineFeatures = new AdvancedMachineFeatures(), - CpuPlatform = "cpu_platformd5794042", - LastStopTimestamp = "last_stop_timestampd336a8f1", - Description = "description2cf9da67", - LastStartTimestamp = "last_start_timestampe26bd347", - SelfLink = "self_link7e87f12d", - DeletionProtection = false, - GuestAccelerators = - { - new AcceleratorConfig(), - }, - CanIpForward = true, - SatisfiesPzs = false, - ConfidentialInstanceConfig = new ConfidentialInstanceConfig(), - Labels = - { - { - "key8a0b6e3c", - "value60c16320" - }, - }, - }; - mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Instance responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Instance responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Get() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetInstanceRequest request = new GetInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - Instance expectedResponse = new Instance - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Tags = new Tags(), - Zone = "zone255f4ea8", - ShieldedInstanceConfig = new ShieldedInstanceConfig(), - ResourcePolicies = - { - "resource_policiesdff15734", - }, - CreationTimestamp = "creation_timestamp235e59a1", - PrivateIpv6GoogleAccess = Instance.Types.PrivateIpv6GoogleAccess.InheritFromSubnetwork, - NetworkInterfaces = - { - new NetworkInterface(), - }, - Metadata = new Metadata(), - Disks = { new AttachedDisk(), }, - StartRestricted = true, - ReservationAffinity = new ReservationAffinity(), - ShieldedInstanceIntegrityPolicy = new ShieldedInstanceIntegrityPolicy(), - LabelFingerprint = "label_fingerprint06ccff3a", - Status = Instance.Types.Status.Provisioning, - MachineType = "machine_type68ce40fa", - Fingerprint = "fingerprint009e6052", - Hostname = "hostnamef4ac9708", - MinCpuPlatform = "min_cpu_platformf71ffa67", - DisplayDevice = new DisplayDevice(), - ServiceAccounts = - { - new ServiceAccount(), - }, - StatusMessage = "status_message2c618f86", - LastSuspendedTimestamp = "last_suspended_timestamp1e59392b", - Scheduling = new Scheduling(), - AdvancedMachineFeatures = new AdvancedMachineFeatures(), - CpuPlatform = "cpu_platformd5794042", - LastStopTimestamp = "last_stop_timestampd336a8f1", - Description = "description2cf9da67", - LastStartTimestamp = "last_start_timestampe26bd347", - SelfLink = "self_link7e87f12d", - DeletionProtection = false, - GuestAccelerators = - { - new AcceleratorConfig(), - }, - CanIpForward = true, - SatisfiesPzs = false, - ConfidentialInstanceConfig = new ConfidentialInstanceConfig(), - Labels = - { - { - "key8a0b6e3c", - "value60c16320" - }, - }, - }; - mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Instance response = client.Get(request.Project, request.Zone, request.Instance); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetInstanceRequest request = new GetInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - Instance expectedResponse = new Instance - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Tags = new Tags(), - Zone = "zone255f4ea8", - ShieldedInstanceConfig = new ShieldedInstanceConfig(), - ResourcePolicies = - { - "resource_policiesdff15734", - }, - CreationTimestamp = "creation_timestamp235e59a1", - PrivateIpv6GoogleAccess = Instance.Types.PrivateIpv6GoogleAccess.InheritFromSubnetwork, - NetworkInterfaces = - { - new NetworkInterface(), - }, - Metadata = new Metadata(), - Disks = { new AttachedDisk(), }, - StartRestricted = true, - ReservationAffinity = new ReservationAffinity(), - ShieldedInstanceIntegrityPolicy = new ShieldedInstanceIntegrityPolicy(), - LabelFingerprint = "label_fingerprint06ccff3a", - Status = Instance.Types.Status.Provisioning, - MachineType = "machine_type68ce40fa", - Fingerprint = "fingerprint009e6052", - Hostname = "hostnamef4ac9708", - MinCpuPlatform = "min_cpu_platformf71ffa67", - DisplayDevice = new DisplayDevice(), - ServiceAccounts = - { - new ServiceAccount(), - }, - StatusMessage = "status_message2c618f86", - LastSuspendedTimestamp = "last_suspended_timestamp1e59392b", - Scheduling = new Scheduling(), - AdvancedMachineFeatures = new AdvancedMachineFeatures(), - CpuPlatform = "cpu_platformd5794042", - LastStopTimestamp = "last_stop_timestampd336a8f1", - Description = "description2cf9da67", - LastStartTimestamp = "last_start_timestampe26bd347", - SelfLink = "self_link7e87f12d", - DeletionProtection = false, - GuestAccelerators = - { - new AcceleratorConfig(), - }, - CanIpForward = true, - SatisfiesPzs = false, - ConfidentialInstanceConfig = new ConfidentialInstanceConfig(), - Labels = - { - { - "key8a0b6e3c", - "value60c16320" - }, - }, - }; - mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Instance responseCallSettings = await client.GetAsync(request.Project, request.Zone, request.Instance, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Instance responseCancellationToken = await client.GetAsync(request.Project, request.Zone, request.Instance, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetEffectiveFirewallsRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetEffectiveFirewallsInstanceRequest request = new GetEffectiveFirewallsInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - NetworkInterface = "network_interfaceb50da44f", - }; - InstancesGetEffectiveFirewallsResponse expectedResponse = new InstancesGetEffectiveFirewallsResponse - { - Firewalls = { new Firewall(), }, - FirewallPolicys = - { - new InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy(), - }, - }; - mockGrpcClient.Setup(x => x.GetEffectiveFirewalls(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - InstancesGetEffectiveFirewallsResponse response = client.GetEffectiveFirewalls(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetEffectiveFirewallsRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetEffectiveFirewallsInstanceRequest request = new GetEffectiveFirewallsInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - NetworkInterface = "network_interfaceb50da44f", - }; - InstancesGetEffectiveFirewallsResponse expectedResponse = new InstancesGetEffectiveFirewallsResponse - { - Firewalls = { new Firewall(), }, - FirewallPolicys = - { - new InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy(), - }, - }; - mockGrpcClient.Setup(x => x.GetEffectiveFirewallsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - InstancesGetEffectiveFirewallsResponse responseCallSettings = await client.GetEffectiveFirewallsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - InstancesGetEffectiveFirewallsResponse responseCancellationToken = await client.GetEffectiveFirewallsAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetEffectiveFirewalls() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetEffectiveFirewallsInstanceRequest request = new GetEffectiveFirewallsInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - NetworkInterface = "network_interfaceb50da44f", - }; - InstancesGetEffectiveFirewallsResponse expectedResponse = new InstancesGetEffectiveFirewallsResponse - { - Firewalls = { new Firewall(), }, - FirewallPolicys = - { - new InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy(), - }, - }; - mockGrpcClient.Setup(x => x.GetEffectiveFirewalls(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - InstancesGetEffectiveFirewallsResponse response = client.GetEffectiveFirewalls(request.Project, request.Zone, request.Instance, request.NetworkInterface); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetEffectiveFirewallsAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetEffectiveFirewallsInstanceRequest request = new GetEffectiveFirewallsInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - NetworkInterface = "network_interfaceb50da44f", - }; - InstancesGetEffectiveFirewallsResponse expectedResponse = new InstancesGetEffectiveFirewallsResponse - { - Firewalls = { new Firewall(), }, - FirewallPolicys = - { - new InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy(), - }, - }; - mockGrpcClient.Setup(x => x.GetEffectiveFirewallsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - InstancesGetEffectiveFirewallsResponse responseCallSettings = await client.GetEffectiveFirewallsAsync(request.Project, request.Zone, request.Instance, request.NetworkInterface, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - InstancesGetEffectiveFirewallsResponse responseCancellationToken = await client.GetEffectiveFirewallsAsync(request.Project, request.Zone, request.Instance, request.NetworkInterface, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetGuestAttributesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetGuestAttributesInstanceRequest request = new GetGuestAttributesInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - VariableKey = "variable_key1c249a45", - Project = "projectaa6ff846", - QueryPath = "query_pathf44da93a", - }; - GuestAttributes expectedResponse = new GuestAttributes - { - Kind = "kindf7aa39d9", - VariableValue = "variable_value61cc0fab", - QueryValue = new GuestAttributesValue(), - VariableKey = "variable_key1c249a45", - QueryPath = "query_pathf44da93a", - SelfLink = "self_link7e87f12d", - }; - mockGrpcClient.Setup(x => x.GetGuestAttributes(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - GuestAttributes response = client.GetGuestAttributes(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetGuestAttributesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetGuestAttributesInstanceRequest request = new GetGuestAttributesInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - VariableKey = "variable_key1c249a45", - Project = "projectaa6ff846", - QueryPath = "query_pathf44da93a", - }; - GuestAttributes expectedResponse = new GuestAttributes - { - Kind = "kindf7aa39d9", - VariableValue = "variable_value61cc0fab", - QueryValue = new GuestAttributesValue(), - VariableKey = "variable_key1c249a45", - QueryPath = "query_pathf44da93a", - SelfLink = "self_link7e87f12d", - }; - mockGrpcClient.Setup(x => x.GetGuestAttributesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - GuestAttributes responseCallSettings = await client.GetGuestAttributesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - GuestAttributes responseCancellationToken = await client.GetGuestAttributesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetGuestAttributes() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetGuestAttributesInstanceRequest request = new GetGuestAttributesInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - GuestAttributes expectedResponse = new GuestAttributes - { - Kind = "kindf7aa39d9", - VariableValue = "variable_value61cc0fab", - QueryValue = new GuestAttributesValue(), - VariableKey = "variable_key1c249a45", - QueryPath = "query_pathf44da93a", - SelfLink = "self_link7e87f12d", - }; - mockGrpcClient.Setup(x => x.GetGuestAttributes(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - GuestAttributes response = client.GetGuestAttributes(request.Project, request.Zone, request.Instance); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetGuestAttributesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetGuestAttributesInstanceRequest request = new GetGuestAttributesInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - GuestAttributes expectedResponse = new GuestAttributes - { - Kind = "kindf7aa39d9", - VariableValue = "variable_value61cc0fab", - QueryValue = new GuestAttributesValue(), - VariableKey = "variable_key1c249a45", - QueryPath = "query_pathf44da93a", - SelfLink = "self_link7e87f12d", - }; - mockGrpcClient.Setup(x => x.GetGuestAttributesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - GuestAttributes responseCallSettings = await client.GetGuestAttributesAsync(request.Project, request.Zone, request.Instance, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - GuestAttributes responseCancellationToken = await client.GetGuestAttributesAsync(request.Project, request.Zone, request.Instance, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetIamPolicyRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetIamPolicyInstanceRequest request = new GetIamPolicyInstanceRequest - { - Zone = "zone255f4ea8", - Resource = "resource164eab96", - Project = "projectaa6ff846", - OptionsRequestedPolicyVersion = -1471234741, - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.GetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Policy response = client.GetIamPolicy(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetIamPolicyRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetIamPolicyInstanceRequest request = new GetIamPolicyInstanceRequest - { - Zone = "zone255f4ea8", - Resource = "resource164eab96", - Project = "projectaa6ff846", - OptionsRequestedPolicyVersion = -1471234741, - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.GetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Policy responseCallSettings = await client.GetIamPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Policy responseCancellationToken = await client.GetIamPolicyAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetIamPolicy() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetIamPolicyInstanceRequest request = new GetIamPolicyInstanceRequest - { - Zone = "zone255f4ea8", - Resource = "resource164eab96", - Project = "projectaa6ff846", - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.GetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Policy response = client.GetIamPolicy(request.Project, request.Zone, request.Resource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetIamPolicyAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetIamPolicyInstanceRequest request = new GetIamPolicyInstanceRequest - { - Zone = "zone255f4ea8", - Resource = "resource164eab96", - Project = "projectaa6ff846", - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.GetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Policy responseCallSettings = await client.GetIamPolicyAsync(request.Project, request.Zone, request.Resource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Policy responseCancellationToken = await client.GetIamPolicyAsync(request.Project, request.Zone, request.Resource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetScreenshotRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetScreenshotInstanceRequest request = new GetScreenshotInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - Screenshot expectedResponse = new Screenshot - { - Kind = "kindf7aa39d9", - Contents = "contents8c7dbf98", - }; - mockGrpcClient.Setup(x => x.GetScreenshot(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Screenshot response = client.GetScreenshot(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetScreenshotRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetScreenshotInstanceRequest request = new GetScreenshotInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - Screenshot expectedResponse = new Screenshot - { - Kind = "kindf7aa39d9", - Contents = "contents8c7dbf98", - }; - mockGrpcClient.Setup(x => x.GetScreenshotAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Screenshot responseCallSettings = await client.GetScreenshotAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Screenshot responseCancellationToken = await client.GetScreenshotAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetScreenshot() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetScreenshotInstanceRequest request = new GetScreenshotInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - Screenshot expectedResponse = new Screenshot - { - Kind = "kindf7aa39d9", - Contents = "contents8c7dbf98", - }; - mockGrpcClient.Setup(x => x.GetScreenshot(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Screenshot response = client.GetScreenshot(request.Project, request.Zone, request.Instance); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetScreenshotAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetScreenshotInstanceRequest request = new GetScreenshotInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - Screenshot expectedResponse = new Screenshot - { - Kind = "kindf7aa39d9", - Contents = "contents8c7dbf98", - }; - mockGrpcClient.Setup(x => x.GetScreenshotAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Screenshot responseCallSettings = await client.GetScreenshotAsync(request.Project, request.Zone, request.Instance, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Screenshot responseCancellationToken = await client.GetScreenshotAsync(request.Project, request.Zone, request.Instance, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetSerialPortOutputRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetSerialPortOutputInstanceRequest request = new GetSerialPortOutputInstanceRequest - { - Port = -78310000, - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Start = -5616678393427383318L, - Project = "projectaa6ff846", - }; - SerialPortOutput expectedResponse = new SerialPortOutput - { - Kind = "kindf7aa39d9", - Next = 9139246809011047120L, - Start = -5616678393427383318L, - SelfLink = "self_link7e87f12d", - Contents = "contents8c7dbf98", - }; - mockGrpcClient.Setup(x => x.GetSerialPortOutput(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - SerialPortOutput response = client.GetSerialPortOutput(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetSerialPortOutputRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetSerialPortOutputInstanceRequest request = new GetSerialPortOutputInstanceRequest - { - Port = -78310000, - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Start = -5616678393427383318L, - Project = "projectaa6ff846", - }; - SerialPortOutput expectedResponse = new SerialPortOutput - { - Kind = "kindf7aa39d9", - Next = 9139246809011047120L, - Start = -5616678393427383318L, - SelfLink = "self_link7e87f12d", - Contents = "contents8c7dbf98", - }; - mockGrpcClient.Setup(x => x.GetSerialPortOutputAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - SerialPortOutput responseCallSettings = await client.GetSerialPortOutputAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - SerialPortOutput responseCancellationToken = await client.GetSerialPortOutputAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetSerialPortOutput() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetSerialPortOutputInstanceRequest request = new GetSerialPortOutputInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - SerialPortOutput expectedResponse = new SerialPortOutput - { - Kind = "kindf7aa39d9", - Next = 9139246809011047120L, - Start = -5616678393427383318L, - SelfLink = "self_link7e87f12d", - Contents = "contents8c7dbf98", - }; - mockGrpcClient.Setup(x => x.GetSerialPortOutput(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - SerialPortOutput response = client.GetSerialPortOutput(request.Project, request.Zone, request.Instance); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetSerialPortOutputAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetSerialPortOutputInstanceRequest request = new GetSerialPortOutputInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - SerialPortOutput expectedResponse = new SerialPortOutput - { - Kind = "kindf7aa39d9", - Next = 9139246809011047120L, - Start = -5616678393427383318L, - SelfLink = "self_link7e87f12d", - Contents = "contents8c7dbf98", - }; - mockGrpcClient.Setup(x => x.GetSerialPortOutputAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - SerialPortOutput responseCallSettings = await client.GetSerialPortOutputAsync(request.Project, request.Zone, request.Instance, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - SerialPortOutput responseCancellationToken = await client.GetSerialPortOutputAsync(request.Project, request.Zone, request.Instance, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetShieldedInstanceIdentityRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetShieldedInstanceIdentityInstanceRequest request = new GetShieldedInstanceIdentityInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - ShieldedInstanceIdentity expectedResponse = new ShieldedInstanceIdentity - { - Kind = "kindf7aa39d9", - SigningKey = new ShieldedInstanceIdentityEntry(), - EncryptionKey = new ShieldedInstanceIdentityEntry(), - }; - mockGrpcClient.Setup(x => x.GetShieldedInstanceIdentity(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - ShieldedInstanceIdentity response = client.GetShieldedInstanceIdentity(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetShieldedInstanceIdentityRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetShieldedInstanceIdentityInstanceRequest request = new GetShieldedInstanceIdentityInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - ShieldedInstanceIdentity expectedResponse = new ShieldedInstanceIdentity - { - Kind = "kindf7aa39d9", - SigningKey = new ShieldedInstanceIdentityEntry(), - EncryptionKey = new ShieldedInstanceIdentityEntry(), - }; - mockGrpcClient.Setup(x => x.GetShieldedInstanceIdentityAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - ShieldedInstanceIdentity responseCallSettings = await client.GetShieldedInstanceIdentityAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - ShieldedInstanceIdentity responseCancellationToken = await client.GetShieldedInstanceIdentityAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetShieldedInstanceIdentity() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetShieldedInstanceIdentityInstanceRequest request = new GetShieldedInstanceIdentityInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - ShieldedInstanceIdentity expectedResponse = new ShieldedInstanceIdentity - { - Kind = "kindf7aa39d9", - SigningKey = new ShieldedInstanceIdentityEntry(), - EncryptionKey = new ShieldedInstanceIdentityEntry(), - }; - mockGrpcClient.Setup(x => x.GetShieldedInstanceIdentity(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - ShieldedInstanceIdentity response = client.GetShieldedInstanceIdentity(request.Project, request.Zone, request.Instance); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetShieldedInstanceIdentityAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetShieldedInstanceIdentityInstanceRequest request = new GetShieldedInstanceIdentityInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - ShieldedInstanceIdentity expectedResponse = new ShieldedInstanceIdentity - { - Kind = "kindf7aa39d9", - SigningKey = new ShieldedInstanceIdentityEntry(), - EncryptionKey = new ShieldedInstanceIdentityEntry(), - }; - mockGrpcClient.Setup(x => x.GetShieldedInstanceIdentityAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - ShieldedInstanceIdentity responseCallSettings = await client.GetShieldedInstanceIdentityAsync(request.Project, request.Zone, request.Instance, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - ShieldedInstanceIdentity responseCancellationToken = await client.GetShieldedInstanceIdentityAsync(request.Project, request.Zone, request.Instance, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInstanceRequest request = new InsertInstanceRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - InstanceResource = new Instance(), - Project = "projectaa6ff846", - SourceInstanceTemplate = "source_instance_template4b774557", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInstanceRequest request = new InsertInstanceRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - InstanceResource = new Instance(), - Project = "projectaa6ff846", - SourceInstanceTemplate = "source_instance_template4b774557", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInstanceRequest request = new InsertInstanceRequest - { - Zone = "zone255f4ea8", - InstanceResource = new Instance(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Zone, request.InstanceResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInstanceRequest request = new InsertInstanceRequest - { - Zone = "zone255f4ea8", - InstanceResource = new Instance(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Zone, request.InstanceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Zone, request.InstanceResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void RemoveResourcePoliciesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveResourcePoliciesInstanceRequest request = new RemoveResourcePoliciesInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - InstancesRemoveResourcePoliciesRequestResource = new InstancesRemoveResourcePoliciesRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveResourcePolicies(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.RemoveResourcePolicies(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task RemoveResourcePoliciesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveResourcePoliciesInstanceRequest request = new RemoveResourcePoliciesInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - InstancesRemoveResourcePoliciesRequestResource = new InstancesRemoveResourcePoliciesRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveResourcePoliciesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RemoveResourcePoliciesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RemoveResourcePoliciesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void RemoveResourcePolicies() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveResourcePoliciesInstanceRequest request = new RemoveResourcePoliciesInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - InstancesRemoveResourcePoliciesRequestResource = new InstancesRemoveResourcePoliciesRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveResourcePolicies(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.RemoveResourcePolicies(request.Project, request.Zone, request.Instance, request.InstancesRemoveResourcePoliciesRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task RemoveResourcePoliciesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveResourcePoliciesInstanceRequest request = new RemoveResourcePoliciesInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - InstancesRemoveResourcePoliciesRequestResource = new InstancesRemoveResourcePoliciesRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveResourcePoliciesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RemoveResourcePoliciesAsync(request.Project, request.Zone, request.Instance, request.InstancesRemoveResourcePoliciesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RemoveResourcePoliciesAsync(request.Project, request.Zone, request.Instance, request.InstancesRemoveResourcePoliciesRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void ResetRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResetInstanceRequest request = new ResetInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Reset(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Reset(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task ResetRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResetInstanceRequest request = new ResetInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.ResetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.ResetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.ResetAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Reset() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResetInstanceRequest request = new ResetInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Reset(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Reset(request.Project, request.Zone, request.Instance); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task ResetAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResetInstanceRequest request = new ResetInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.ResetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.ResetAsync(request.Project, request.Zone, request.Instance, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.ResetAsync(request.Project, request.Zone, request.Instance, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetDeletionProtectionRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetDeletionProtectionInstanceRequest request = new SetDeletionProtectionInstanceRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Resource = "resource164eab96", - Project = "projectaa6ff846", - DeletionProtection = false, - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetDeletionProtection(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetDeletionProtection(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetDeletionProtectionRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetDeletionProtectionInstanceRequest request = new SetDeletionProtectionInstanceRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Resource = "resource164eab96", - Project = "projectaa6ff846", - DeletionProtection = false, - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetDeletionProtectionAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetDeletionProtectionAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetDeletionProtectionAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetDeletionProtection() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetDeletionProtectionInstanceRequest request = new SetDeletionProtectionInstanceRequest - { - Zone = "zone255f4ea8", - Resource = "resource164eab96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetDeletionProtection(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetDeletionProtection(request.Project, request.Zone, request.Resource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetDeletionProtectionAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetDeletionProtectionInstanceRequest request = new SetDeletionProtectionInstanceRequest - { - Zone = "zone255f4ea8", - Resource = "resource164eab96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetDeletionProtectionAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetDeletionProtectionAsync(request.Project, request.Zone, request.Resource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetDeletionProtectionAsync(request.Project, request.Zone, request.Resource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetDiskAutoDeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetDiskAutoDeleteInstanceRequest request = new SetDiskAutoDeleteInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - DeviceName = "device_name41d7923b", - Project = "projectaa6ff846", - AutoDelete = true, - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetDiskAutoDelete(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetDiskAutoDelete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetDiskAutoDeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetDiskAutoDeleteInstanceRequest request = new SetDiskAutoDeleteInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - DeviceName = "device_name41d7923b", - Project = "projectaa6ff846", - AutoDelete = true, - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetDiskAutoDeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetDiskAutoDeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetDiskAutoDeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetDiskAutoDelete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetDiskAutoDeleteInstanceRequest request = new SetDiskAutoDeleteInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - DeviceName = "device_name41d7923b", - Project = "projectaa6ff846", - AutoDelete = true, - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetDiskAutoDelete(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetDiskAutoDelete(request.Project, request.Zone, request.Instance, request.AutoDelete, request.DeviceName); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetDiskAutoDeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetDiskAutoDeleteInstanceRequest request = new SetDiskAutoDeleteInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - DeviceName = "device_name41d7923b", - Project = "projectaa6ff846", - AutoDelete = true, - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetDiskAutoDeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetDiskAutoDeleteAsync(request.Project, request.Zone, request.Instance, request.AutoDelete, request.DeviceName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetDiskAutoDeleteAsync(request.Project, request.Zone, request.Instance, request.AutoDelete, request.DeviceName, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetIamPolicyRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetIamPolicyInstanceRequest request = new SetIamPolicyInstanceRequest - { - Zone = "zone255f4ea8", - Resource = "resource164eab96", - Project = "projectaa6ff846", - ZoneSetPolicyRequestResource = new ZoneSetPolicyRequest(), - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.SetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Policy response = client.SetIamPolicy(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetIamPolicyRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetIamPolicyInstanceRequest request = new SetIamPolicyInstanceRequest - { - Zone = "zone255f4ea8", - Resource = "resource164eab96", - Project = "projectaa6ff846", - ZoneSetPolicyRequestResource = new ZoneSetPolicyRequest(), - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.SetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Policy responseCallSettings = await client.SetIamPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Policy responseCancellationToken = await client.SetIamPolicyAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetIamPolicy() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetIamPolicyInstanceRequest request = new SetIamPolicyInstanceRequest - { - Zone = "zone255f4ea8", - Resource = "resource164eab96", - Project = "projectaa6ff846", - ZoneSetPolicyRequestResource = new ZoneSetPolicyRequest(), - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.SetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Policy response = client.SetIamPolicy(request.Project, request.Zone, request.Resource, request.ZoneSetPolicyRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetIamPolicyAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetIamPolicyInstanceRequest request = new SetIamPolicyInstanceRequest - { - Zone = "zone255f4ea8", - Resource = "resource164eab96", - Project = "projectaa6ff846", - ZoneSetPolicyRequestResource = new ZoneSetPolicyRequest(), - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.SetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Policy responseCallSettings = await client.SetIamPolicyAsync(request.Project, request.Zone, request.Resource, request.ZoneSetPolicyRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Policy responseCancellationToken = await client.SetIamPolicyAsync(request.Project, request.Zone, request.Resource, request.ZoneSetPolicyRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetLabelsRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsInstanceRequest request = new SetLabelsInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - InstancesSetLabelsRequestResource = new InstancesSetLabelsRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabels(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetLabels(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetLabelsRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsInstanceRequest request = new SetLabelsInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - InstancesSetLabelsRequestResource = new InstancesSetLabelsRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabelsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetLabelsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetLabelsAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetLabels() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsInstanceRequest request = new SetLabelsInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - InstancesSetLabelsRequestResource = new InstancesSetLabelsRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabels(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetLabels(request.Project, request.Zone, request.Instance, request.InstancesSetLabelsRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetLabelsAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsInstanceRequest request = new SetLabelsInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - InstancesSetLabelsRequestResource = new InstancesSetLabelsRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabelsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetLabelsAsync(request.Project, request.Zone, request.Instance, request.InstancesSetLabelsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetLabelsAsync(request.Project, request.Zone, request.Instance, request.InstancesSetLabelsRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetMachineResourcesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetMachineResourcesInstanceRequest request = new SetMachineResourcesInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - InstancesSetMachineResourcesRequestResource = new InstancesSetMachineResourcesRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetMachineResources(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetMachineResources(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetMachineResourcesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetMachineResourcesInstanceRequest request = new SetMachineResourcesInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - InstancesSetMachineResourcesRequestResource = new InstancesSetMachineResourcesRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetMachineResourcesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetMachineResourcesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetMachineResourcesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetMachineResources() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetMachineResourcesInstanceRequest request = new SetMachineResourcesInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - InstancesSetMachineResourcesRequestResource = new InstancesSetMachineResourcesRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetMachineResources(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetMachineResources(request.Project, request.Zone, request.Instance, request.InstancesSetMachineResourcesRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetMachineResourcesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetMachineResourcesInstanceRequest request = new SetMachineResourcesInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - InstancesSetMachineResourcesRequestResource = new InstancesSetMachineResourcesRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetMachineResourcesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetMachineResourcesAsync(request.Project, request.Zone, request.Instance, request.InstancesSetMachineResourcesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetMachineResourcesAsync(request.Project, request.Zone, request.Instance, request.InstancesSetMachineResourcesRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetMachineTypeRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetMachineTypeInstanceRequest request = new SetMachineTypeInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstancesSetMachineTypeRequestResource = new InstancesSetMachineTypeRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetMachineType(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetMachineType(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetMachineTypeRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetMachineTypeInstanceRequest request = new SetMachineTypeInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstancesSetMachineTypeRequestResource = new InstancesSetMachineTypeRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetMachineTypeAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetMachineTypeAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetMachineTypeAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetMachineType() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetMachineTypeInstanceRequest request = new SetMachineTypeInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - InstancesSetMachineTypeRequestResource = new InstancesSetMachineTypeRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetMachineType(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetMachineType(request.Project, request.Zone, request.Instance, request.InstancesSetMachineTypeRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetMachineTypeAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetMachineTypeInstanceRequest request = new SetMachineTypeInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - InstancesSetMachineTypeRequestResource = new InstancesSetMachineTypeRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetMachineTypeAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetMachineTypeAsync(request.Project, request.Zone, request.Instance, request.InstancesSetMachineTypeRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetMachineTypeAsync(request.Project, request.Zone, request.Instance, request.InstancesSetMachineTypeRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetMetadataRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetMetadataInstanceRequest request = new SetMetadataInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - MetadataResource = new Metadata(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetMetadata(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetMetadata(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetMetadataRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetMetadataInstanceRequest request = new SetMetadataInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - MetadataResource = new Metadata(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetMetadataAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetMetadataAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetMetadataAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetMetadata() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetMetadataInstanceRequest request = new SetMetadataInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - MetadataResource = new Metadata(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetMetadata(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetMetadata(request.Project, request.Zone, request.Instance, request.MetadataResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetMetadataAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetMetadataInstanceRequest request = new SetMetadataInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - MetadataResource = new Metadata(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetMetadataAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetMetadataAsync(request.Project, request.Zone, request.Instance, request.MetadataResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetMetadataAsync(request.Project, request.Zone, request.Instance, request.MetadataResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetMinCpuPlatformRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetMinCpuPlatformInstanceRequest request = new SetMinCpuPlatformInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - InstancesSetMinCpuPlatformRequestResource = new InstancesSetMinCpuPlatformRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetMinCpuPlatform(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetMinCpuPlatform(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetMinCpuPlatformRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetMinCpuPlatformInstanceRequest request = new SetMinCpuPlatformInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - InstancesSetMinCpuPlatformRequestResource = new InstancesSetMinCpuPlatformRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetMinCpuPlatformAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetMinCpuPlatformAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetMinCpuPlatformAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetMinCpuPlatform() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetMinCpuPlatformInstanceRequest request = new SetMinCpuPlatformInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - InstancesSetMinCpuPlatformRequestResource = new InstancesSetMinCpuPlatformRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetMinCpuPlatform(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetMinCpuPlatform(request.Project, request.Zone, request.Instance, request.InstancesSetMinCpuPlatformRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetMinCpuPlatformAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetMinCpuPlatformInstanceRequest request = new SetMinCpuPlatformInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - InstancesSetMinCpuPlatformRequestResource = new InstancesSetMinCpuPlatformRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetMinCpuPlatformAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetMinCpuPlatformAsync(request.Project, request.Zone, request.Instance, request.InstancesSetMinCpuPlatformRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetMinCpuPlatformAsync(request.Project, request.Zone, request.Instance, request.InstancesSetMinCpuPlatformRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetSchedulingRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSchedulingInstanceRequest request = new SetSchedulingInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - SchedulingResource = new Scheduling(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetScheduling(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetScheduling(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetSchedulingRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSchedulingInstanceRequest request = new SetSchedulingInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - SchedulingResource = new Scheduling(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetSchedulingAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetSchedulingAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetSchedulingAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetScheduling() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSchedulingInstanceRequest request = new SetSchedulingInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - SchedulingResource = new Scheduling(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetScheduling(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetScheduling(request.Project, request.Zone, request.Instance, request.SchedulingResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetSchedulingAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSchedulingInstanceRequest request = new SetSchedulingInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - SchedulingResource = new Scheduling(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetSchedulingAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetSchedulingAsync(request.Project, request.Zone, request.Instance, request.SchedulingResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetSchedulingAsync(request.Project, request.Zone, request.Instance, request.SchedulingResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetServiceAccountRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetServiceAccountInstanceRequest request = new SetServiceAccountInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstancesSetServiceAccountRequestResource = new InstancesSetServiceAccountRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetServiceAccount(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetServiceAccount(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetServiceAccountRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetServiceAccountInstanceRequest request = new SetServiceAccountInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstancesSetServiceAccountRequestResource = new InstancesSetServiceAccountRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetServiceAccountAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetServiceAccountAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetServiceAccountAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetServiceAccount() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetServiceAccountInstanceRequest request = new SetServiceAccountInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - InstancesSetServiceAccountRequestResource = new InstancesSetServiceAccountRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetServiceAccount(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetServiceAccount(request.Project, request.Zone, request.Instance, request.InstancesSetServiceAccountRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetServiceAccountAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetServiceAccountInstanceRequest request = new SetServiceAccountInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - InstancesSetServiceAccountRequestResource = new InstancesSetServiceAccountRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetServiceAccountAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetServiceAccountAsync(request.Project, request.Zone, request.Instance, request.InstancesSetServiceAccountRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetServiceAccountAsync(request.Project, request.Zone, request.Instance, request.InstancesSetServiceAccountRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetShieldedInstanceIntegrityPolicyRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetShieldedInstanceIntegrityPolicyInstanceRequest request = new SetShieldedInstanceIntegrityPolicyInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - ShieldedInstanceIntegrityPolicyResource = new ShieldedInstanceIntegrityPolicy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetShieldedInstanceIntegrityPolicy(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetShieldedInstanceIntegrityPolicy(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetShieldedInstanceIntegrityPolicyRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetShieldedInstanceIntegrityPolicyInstanceRequest request = new SetShieldedInstanceIntegrityPolicyInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - ShieldedInstanceIntegrityPolicyResource = new ShieldedInstanceIntegrityPolicy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetShieldedInstanceIntegrityPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetShieldedInstanceIntegrityPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetShieldedInstanceIntegrityPolicyAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetShieldedInstanceIntegrityPolicy() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetShieldedInstanceIntegrityPolicyInstanceRequest request = new SetShieldedInstanceIntegrityPolicyInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - ShieldedInstanceIntegrityPolicyResource = new ShieldedInstanceIntegrityPolicy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetShieldedInstanceIntegrityPolicy(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetShieldedInstanceIntegrityPolicy(request.Project, request.Zone, request.Instance, request.ShieldedInstanceIntegrityPolicyResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetShieldedInstanceIntegrityPolicyAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetShieldedInstanceIntegrityPolicyInstanceRequest request = new SetShieldedInstanceIntegrityPolicyInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - ShieldedInstanceIntegrityPolicyResource = new ShieldedInstanceIntegrityPolicy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetShieldedInstanceIntegrityPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetShieldedInstanceIntegrityPolicyAsync(request.Project, request.Zone, request.Instance, request.ShieldedInstanceIntegrityPolicyResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetShieldedInstanceIntegrityPolicyAsync(request.Project, request.Zone, request.Instance, request.ShieldedInstanceIntegrityPolicyResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetTagsRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetTagsInstanceRequest request = new SetTagsInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - TagsResource = new Tags(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetTags(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetTags(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetTagsRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetTagsInstanceRequest request = new SetTagsInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - TagsResource = new Tags(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetTagsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetTagsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetTagsAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetTags() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetTagsInstanceRequest request = new SetTagsInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - TagsResource = new Tags(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetTags(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetTags(request.Project, request.Zone, request.Instance, request.TagsResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetTagsAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetTagsInstanceRequest request = new SetTagsInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - TagsResource = new Tags(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetTagsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetTagsAsync(request.Project, request.Zone, request.Instance, request.TagsResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetTagsAsync(request.Project, request.Zone, request.Instance, request.TagsResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SimulateMaintenanceEventRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SimulateMaintenanceEventInstanceRequest request = new SimulateMaintenanceEventInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SimulateMaintenanceEvent(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SimulateMaintenanceEvent(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SimulateMaintenanceEventRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SimulateMaintenanceEventInstanceRequest request = new SimulateMaintenanceEventInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SimulateMaintenanceEventAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SimulateMaintenanceEventAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SimulateMaintenanceEventAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SimulateMaintenanceEvent() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SimulateMaintenanceEventInstanceRequest request = new SimulateMaintenanceEventInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SimulateMaintenanceEvent(request, moq::It.IsAny())).Returns(expectedResponse); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SimulateMaintenanceEvent(request.Project, request.Zone, request.Instance); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SimulateMaintenanceEventAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SimulateMaintenanceEventInstanceRequest request = new SimulateMaintenanceEventInstanceRequest - { - Zone = "zone255f4ea8", - Instance = "instance99a62371", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SimulateMaintenanceEventAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SimulateMaintenanceEventAsync(request.Project, request.Zone, request.Instance, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SimulateMaintenanceEventAsync(request.Project, request.Zone, request.Instance, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void StartRequestObject() + public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - StartInstanceRequest request = new StartInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetInstanceRequest request = new GetInstanceRequest { Zone = "zone255f4ea8", Instance = "instance99a62371", - RequestId = "request_id362c8df6", Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + Instance expectedResponse = new Instance { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", + Tags = new Tags(), Zone = "zone255f4ea8", + ShieldedInstanceConfig = new ShieldedInstanceConfig(), + ResourcePolicies = + { + "resource_policiesdff15734", + }, CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", + PrivateIpv6GoogleAccess = Instance.Types.PrivateIpv6GoogleAccess.InheritFromSubnetwork, + NetworkInterfaces = + { + new NetworkInterface(), + }, + Metadata = new Metadata(), + Disks = { new AttachedDisk(), }, + StartRestricted = true, + ReservationAffinity = new ReservationAffinity(), + ShieldedInstanceIntegrityPolicy = new ShieldedInstanceIntegrityPolicy(), + LabelFingerprint = "label_fingerprint06ccff3a", + Status = Instance.Types.Status.Provisioning, + MachineType = "machine_type68ce40fa", + Fingerprint = "fingerprint009e6052", + Hostname = "hostnamef4ac9708", + MinCpuPlatform = "min_cpu_platformf71ffa67", + DisplayDevice = new DisplayDevice(), + ServiceAccounts = + { + new ServiceAccount(), + }, StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + LastSuspendedTimestamp = "last_suspended_timestamp1e59392b", + Scheduling = new Scheduling(), + AdvancedMachineFeatures = new AdvancedMachineFeatures(), + CpuPlatform = "cpu_platformd5794042", + LastStopTimestamp = "last_stop_timestampd336a8f1", Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + LastStartTimestamp = "last_start_timestampe26bd347", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + DeletionProtection = false, + GuestAccelerators = + { + new AcceleratorConfig(), + }, + CanIpForward = true, + SatisfiesPzs = false, + ConfidentialInstanceConfig = new ConfidentialInstanceConfig(), + Labels = + { + { + "key8a0b6e3c", + "value60c16320" + }, + }, }; - mockGrpcClient.Setup(x => x.Start(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Start(request); + Instance response = client.Get(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task StartRequestObjectAsync() + public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - StartInstanceRequest request = new StartInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetInstanceRequest request = new GetInstanceRequest { Zone = "zone255f4ea8", Instance = "instance99a62371", - RequestId = "request_id362c8df6", Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + Instance expectedResponse = new Instance { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", + Tags = new Tags(), Zone = "zone255f4ea8", + ShieldedInstanceConfig = new ShieldedInstanceConfig(), + ResourcePolicies = + { + "resource_policiesdff15734", + }, CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", + PrivateIpv6GoogleAccess = Instance.Types.PrivateIpv6GoogleAccess.InheritFromSubnetwork, + NetworkInterfaces = + { + new NetworkInterface(), + }, + Metadata = new Metadata(), + Disks = { new AttachedDisk(), }, + StartRestricted = true, + ReservationAffinity = new ReservationAffinity(), + ShieldedInstanceIntegrityPolicy = new ShieldedInstanceIntegrityPolicy(), + LabelFingerprint = "label_fingerprint06ccff3a", + Status = Instance.Types.Status.Provisioning, + MachineType = "machine_type68ce40fa", + Fingerprint = "fingerprint009e6052", + Hostname = "hostnamef4ac9708", + MinCpuPlatform = "min_cpu_platformf71ffa67", + DisplayDevice = new DisplayDevice(), + ServiceAccounts = + { + new ServiceAccount(), + }, StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + LastSuspendedTimestamp = "last_suspended_timestamp1e59392b", + Scheduling = new Scheduling(), + AdvancedMachineFeatures = new AdvancedMachineFeatures(), + CpuPlatform = "cpu_platformd5794042", + LastStopTimestamp = "last_stop_timestampd336a8f1", Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + LastStartTimestamp = "last_start_timestampe26bd347", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + DeletionProtection = false, + GuestAccelerators = + { + new AcceleratorConfig(), + }, + CanIpForward = true, + SatisfiesPzs = false, + ConfidentialInstanceConfig = new ConfidentialInstanceConfig(), + Labels = + { + { + "key8a0b6e3c", + "value60c16320" + }, + }, }; - mockGrpcClient.Setup(x => x.StartAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.StartAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Instance responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.StartAsync(request, st::CancellationToken.None); + Instance responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void Start() + public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - StartInstanceRequest request = new StartInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetInstanceRequest request = new GetInstanceRequest { Zone = "zone255f4ea8", Instance = "instance99a62371", Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + Instance expectedResponse = new Instance { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", + Tags = new Tags(), Zone = "zone255f4ea8", + ShieldedInstanceConfig = new ShieldedInstanceConfig(), + ResourcePolicies = + { + "resource_policiesdff15734", + }, CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", + PrivateIpv6GoogleAccess = Instance.Types.PrivateIpv6GoogleAccess.InheritFromSubnetwork, + NetworkInterfaces = + { + new NetworkInterface(), + }, + Metadata = new Metadata(), + Disks = { new AttachedDisk(), }, + StartRestricted = true, + ReservationAffinity = new ReservationAffinity(), + ShieldedInstanceIntegrityPolicy = new ShieldedInstanceIntegrityPolicy(), + LabelFingerprint = "label_fingerprint06ccff3a", + Status = Instance.Types.Status.Provisioning, + MachineType = "machine_type68ce40fa", + Fingerprint = "fingerprint009e6052", + Hostname = "hostnamef4ac9708", + MinCpuPlatform = "min_cpu_platformf71ffa67", + DisplayDevice = new DisplayDevice(), + ServiceAccounts = + { + new ServiceAccount(), + }, StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + LastSuspendedTimestamp = "last_suspended_timestamp1e59392b", + Scheduling = new Scheduling(), + AdvancedMachineFeatures = new AdvancedMachineFeatures(), + CpuPlatform = "cpu_platformd5794042", + LastStopTimestamp = "last_stop_timestampd336a8f1", Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + LastStartTimestamp = "last_start_timestampe26bd347", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + DeletionProtection = false, + GuestAccelerators = + { + new AcceleratorConfig(), + }, + CanIpForward = true, + SatisfiesPzs = false, + ConfidentialInstanceConfig = new ConfidentialInstanceConfig(), + Labels = + { + { + "key8a0b6e3c", + "value60c16320" + }, + }, }; - mockGrpcClient.Setup(x => x.Start(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Start(request.Project, request.Zone, request.Instance); + Instance response = client.Get(request.Project, request.Zone, request.Instance); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task StartAsync() + public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - StartInstanceRequest request = new StartInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetInstanceRequest request = new GetInstanceRequest { Zone = "zone255f4ea8", Instance = "instance99a62371", Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + Instance expectedResponse = new Instance { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", + Tags = new Tags(), Zone = "zone255f4ea8", + ShieldedInstanceConfig = new ShieldedInstanceConfig(), + ResourcePolicies = + { + "resource_policiesdff15734", + }, CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", + PrivateIpv6GoogleAccess = Instance.Types.PrivateIpv6GoogleAccess.InheritFromSubnetwork, + NetworkInterfaces = + { + new NetworkInterface(), + }, + Metadata = new Metadata(), + Disks = { new AttachedDisk(), }, + StartRestricted = true, + ReservationAffinity = new ReservationAffinity(), + ShieldedInstanceIntegrityPolicy = new ShieldedInstanceIntegrityPolicy(), + LabelFingerprint = "label_fingerprint06ccff3a", + Status = Instance.Types.Status.Provisioning, + MachineType = "machine_type68ce40fa", + Fingerprint = "fingerprint009e6052", + Hostname = "hostnamef4ac9708", + MinCpuPlatform = "min_cpu_platformf71ffa67", + DisplayDevice = new DisplayDevice(), + ServiceAccounts = + { + new ServiceAccount(), + }, StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + LastSuspendedTimestamp = "last_suspended_timestamp1e59392b", + Scheduling = new Scheduling(), + AdvancedMachineFeatures = new AdvancedMachineFeatures(), + CpuPlatform = "cpu_platformd5794042", + LastStopTimestamp = "last_stop_timestampd336a8f1", Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + LastStartTimestamp = "last_start_timestampe26bd347", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + DeletionProtection = false, + GuestAccelerators = + { + new AcceleratorConfig(), + }, + CanIpForward = true, + SatisfiesPzs = false, + ConfidentialInstanceConfig = new ConfidentialInstanceConfig(), + Labels = + { + { + "key8a0b6e3c", + "value60c16320" + }, + }, }; - mockGrpcClient.Setup(x => x.StartAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.StartAsync(request.Project, request.Zone, request.Instance, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Instance responseCallSettings = await client.GetAsync(request.Project, request.Zone, request.Instance, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.StartAsync(request.Project, request.Zone, request.Instance, st::CancellationToken.None); + Instance responseCancellationToken = await client.GetAsync(request.Project, request.Zone, request.Instance, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void StartWithEncryptionKeyRequestObject() + public void GetEffectiveFirewallsRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - StartWithEncryptionKeyInstanceRequest request = new StartWithEncryptionKeyInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetEffectiveFirewallsInstanceRequest request = new GetEffectiveFirewallsInstanceRequest { Zone = "zone255f4ea8", Instance = "instance99a62371", - RequestId = "request_id362c8df6", Project = "projectaa6ff846", - InstancesStartWithEncryptionKeyRequestResource = new InstancesStartWithEncryptionKeyRequest(), + NetworkInterface = "network_interfaceb50da44f", }; - Operation expectedResponse = new Operation + InstancesGetEffectiveFirewallsResponse expectedResponse = new InstancesGetEffectiveFirewallsResponse { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Firewalls = { new Firewall(), }, + FirewallPolicys = + { + new InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy(), + }, }; - mockGrpcClient.Setup(x => x.StartWithEncryptionKey(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetEffectiveFirewalls(request, moq::It.IsAny())).Returns(expectedResponse); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.StartWithEncryptionKey(request); + InstancesGetEffectiveFirewallsResponse response = client.GetEffectiveFirewalls(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task StartWithEncryptionKeyRequestObjectAsync() + public async stt::Task GetEffectiveFirewallsRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - StartWithEncryptionKeyInstanceRequest request = new StartWithEncryptionKeyInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetEffectiveFirewallsInstanceRequest request = new GetEffectiveFirewallsInstanceRequest { Zone = "zone255f4ea8", Instance = "instance99a62371", - RequestId = "request_id362c8df6", Project = "projectaa6ff846", - InstancesStartWithEncryptionKeyRequestResource = new InstancesStartWithEncryptionKeyRequest(), + NetworkInterface = "network_interfaceb50da44f", }; - Operation expectedResponse = new Operation + InstancesGetEffectiveFirewallsResponse expectedResponse = new InstancesGetEffectiveFirewallsResponse { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Firewalls = { new Firewall(), }, + FirewallPolicys = + { + new InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy(), + }, }; - mockGrpcClient.Setup(x => x.StartWithEncryptionKeyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetEffectiveFirewallsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.StartWithEncryptionKeyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + InstancesGetEffectiveFirewallsResponse responseCallSettings = await client.GetEffectiveFirewallsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.StartWithEncryptionKeyAsync(request, st::CancellationToken.None); + InstancesGetEffectiveFirewallsResponse responseCancellationToken = await client.GetEffectiveFirewallsAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void StartWithEncryptionKey() + public void GetEffectiveFirewalls() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - StartWithEncryptionKeyInstanceRequest request = new StartWithEncryptionKeyInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetEffectiveFirewallsInstanceRequest request = new GetEffectiveFirewallsInstanceRequest { Zone = "zone255f4ea8", Instance = "instance99a62371", Project = "projectaa6ff846", - InstancesStartWithEncryptionKeyRequestResource = new InstancesStartWithEncryptionKeyRequest(), + NetworkInterface = "network_interfaceb50da44f", }; - Operation expectedResponse = new Operation + InstancesGetEffectiveFirewallsResponse expectedResponse = new InstancesGetEffectiveFirewallsResponse { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Firewalls = { new Firewall(), }, + FirewallPolicys = + { + new InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy(), + }, }; - mockGrpcClient.Setup(x => x.StartWithEncryptionKey(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetEffectiveFirewalls(request, moq::It.IsAny())).Returns(expectedResponse); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.StartWithEncryptionKey(request.Project, request.Zone, request.Instance, request.InstancesStartWithEncryptionKeyRequestResource); + InstancesGetEffectiveFirewallsResponse response = client.GetEffectiveFirewalls(request.Project, request.Zone, request.Instance, request.NetworkInterface); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task StartWithEncryptionKeyAsync() + public async stt::Task GetEffectiveFirewallsAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - StartWithEncryptionKeyInstanceRequest request = new StartWithEncryptionKeyInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetEffectiveFirewallsInstanceRequest request = new GetEffectiveFirewallsInstanceRequest { Zone = "zone255f4ea8", Instance = "instance99a62371", Project = "projectaa6ff846", - InstancesStartWithEncryptionKeyRequestResource = new InstancesStartWithEncryptionKeyRequest(), + NetworkInterface = "network_interfaceb50da44f", }; - Operation expectedResponse = new Operation + InstancesGetEffectiveFirewallsResponse expectedResponse = new InstancesGetEffectiveFirewallsResponse { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Firewalls = { new Firewall(), }, + FirewallPolicys = + { + new InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy(), + }, }; - mockGrpcClient.Setup(x => x.StartWithEncryptionKeyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetEffectiveFirewallsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.StartWithEncryptionKeyAsync(request.Project, request.Zone, request.Instance, request.InstancesStartWithEncryptionKeyRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + InstancesGetEffectiveFirewallsResponse responseCallSettings = await client.GetEffectiveFirewallsAsync(request.Project, request.Zone, request.Instance, request.NetworkInterface, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.StartWithEncryptionKeyAsync(request.Project, request.Zone, request.Instance, request.InstancesStartWithEncryptionKeyRequestResource, st::CancellationToken.None); + InstancesGetEffectiveFirewallsResponse responseCancellationToken = await client.GetEffectiveFirewallsAsync(request.Project, request.Zone, request.Instance, request.NetworkInterface, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void StopRequestObject() + public void GetGuestAttributesRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - StopInstanceRequest request = new StopInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetGuestAttributesInstanceRequest request = new GetGuestAttributesInstanceRequest { Zone = "zone255f4ea8", Instance = "instance99a62371", - RequestId = "request_id362c8df6", + VariableKey = "variable_key1c249a45", Project = "projectaa6ff846", + QueryPath = "query_pathf44da93a", }; - Operation expectedResponse = new Operation + GuestAttributes expectedResponse = new GuestAttributes { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + VariableValue = "variable_value61cc0fab", + QueryValue = new GuestAttributesValue(), + VariableKey = "variable_key1c249a45", + QueryPath = "query_pathf44da93a", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, }; - mockGrpcClient.Setup(x => x.Stop(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetGuestAttributes(request, moq::It.IsAny())).Returns(expectedResponse); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Stop(request); + GuestAttributes response = client.GetGuestAttributes(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task StopRequestObjectAsync() + public async stt::Task GetGuestAttributesRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - StopInstanceRequest request = new StopInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetGuestAttributesInstanceRequest request = new GetGuestAttributesInstanceRequest { Zone = "zone255f4ea8", Instance = "instance99a62371", - RequestId = "request_id362c8df6", + VariableKey = "variable_key1c249a45", Project = "projectaa6ff846", + QueryPath = "query_pathf44da93a", }; - Operation expectedResponse = new Operation + GuestAttributes expectedResponse = new GuestAttributes { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + VariableValue = "variable_value61cc0fab", + QueryValue = new GuestAttributesValue(), + VariableKey = "variable_key1c249a45", + QueryPath = "query_pathf44da93a", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, }; - mockGrpcClient.Setup(x => x.StopAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetGuestAttributesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.StopAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + GuestAttributes responseCallSettings = await client.GetGuestAttributesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.StopAsync(request, st::CancellationToken.None); + GuestAttributes responseCancellationToken = await client.GetGuestAttributesAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void Stop() + public void GetGuestAttributes() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - StopInstanceRequest request = new StopInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetGuestAttributesInstanceRequest request = new GetGuestAttributesInstanceRequest { Zone = "zone255f4ea8", Instance = "instance99a62371", Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + GuestAttributes expectedResponse = new GuestAttributes { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + VariableValue = "variable_value61cc0fab", + QueryValue = new GuestAttributesValue(), + VariableKey = "variable_key1c249a45", + QueryPath = "query_pathf44da93a", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, }; - mockGrpcClient.Setup(x => x.Stop(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetGuestAttributes(request, moq::It.IsAny())).Returns(expectedResponse); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Stop(request.Project, request.Zone, request.Instance); + GuestAttributes response = client.GetGuestAttributes(request.Project, request.Zone, request.Instance); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task StopAsync() + public async stt::Task GetGuestAttributesAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - StopInstanceRequest request = new StopInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetGuestAttributesInstanceRequest request = new GetGuestAttributesInstanceRequest { Zone = "zone255f4ea8", Instance = "instance99a62371", Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + GuestAttributes expectedResponse = new GuestAttributes { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + VariableValue = "variable_value61cc0fab", + QueryValue = new GuestAttributesValue(), + VariableKey = "variable_key1c249a45", + QueryPath = "query_pathf44da93a", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, }; - mockGrpcClient.Setup(x => x.StopAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetGuestAttributesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.StopAsync(request.Project, request.Zone, request.Instance, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + GuestAttributes responseCallSettings = await client.GetGuestAttributesAsync(request.Project, request.Zone, request.Instance, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.StopAsync(request.Project, request.Zone, request.Instance, st::CancellationToken.None); + GuestAttributes responseCancellationToken = await client.GetGuestAttributesAsync(request.Project, request.Zone, request.Instance, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void TestIamPermissionsRequestObject() + public void GetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - TestIamPermissionsInstanceRequest request = new TestIamPermissionsInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetIamPolicyInstanceRequest request = new GetIamPolicyInstanceRequest { Zone = "zone255f4ea8", Resource = "resource164eab96", Project = "projectaa6ff846", - TestPermissionsRequestResource = new TestPermissionsRequest(), + OptionsRequestedPolicyVersion = -1471234741, }; - TestPermissionsResponse expectedResponse = new TestPermissionsResponse + Policy expectedResponse = new Policy { - Permissions = - { - "permissions535a2741", - }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.TestIamPermissions(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - TestPermissionsResponse response = client.TestIamPermissions(request); + Policy response = client.GetIamPolicy(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task TestIamPermissionsRequestObjectAsync() + public async stt::Task GetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - TestIamPermissionsInstanceRequest request = new TestIamPermissionsInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetIamPolicyInstanceRequest request = new GetIamPolicyInstanceRequest { Zone = "zone255f4ea8", Resource = "resource164eab96", Project = "projectaa6ff846", - TestPermissionsRequestResource = new TestPermissionsRequest(), + OptionsRequestedPolicyVersion = -1471234741, }; - TestPermissionsResponse expectedResponse = new TestPermissionsResponse + Policy expectedResponse = new Policy { - Permissions = - { - "permissions535a2741", - }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.TestIamPermissionsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - TestPermissionsResponse responseCallSettings = await client.TestIamPermissionsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Policy responseCallSettings = await client.GetIamPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - TestPermissionsResponse responseCancellationToken = await client.TestIamPermissionsAsync(request, st::CancellationToken.None); + Policy responseCancellationToken = await client.GetIamPolicyAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void TestIamPermissions() + public void GetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - TestIamPermissionsInstanceRequest request = new TestIamPermissionsInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetIamPolicyInstanceRequest request = new GetIamPolicyInstanceRequest { Zone = "zone255f4ea8", Resource = "resource164eab96", Project = "projectaa6ff846", - TestPermissionsRequestResource = new TestPermissionsRequest(), }; - TestPermissionsResponse expectedResponse = new TestPermissionsResponse + Policy expectedResponse = new Policy { - Permissions = - { - "permissions535a2741", - }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.TestIamPermissions(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - TestPermissionsResponse response = client.TestIamPermissions(request.Project, request.Zone, request.Resource, request.TestPermissionsRequestResource); + Policy response = client.GetIamPolicy(request.Project, request.Zone, request.Resource); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task TestIamPermissionsAsync() + public async stt::Task GetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - TestIamPermissionsInstanceRequest request = new TestIamPermissionsInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetIamPolicyInstanceRequest request = new GetIamPolicyInstanceRequest { Zone = "zone255f4ea8", Resource = "resource164eab96", Project = "projectaa6ff846", - TestPermissionsRequestResource = new TestPermissionsRequest(), }; - TestPermissionsResponse expectedResponse = new TestPermissionsResponse + Policy expectedResponse = new Policy { - Permissions = - { - "permissions535a2741", - }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.TestIamPermissionsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - TestPermissionsResponse responseCallSettings = await client.TestIamPermissionsAsync(request.Project, request.Zone, request.Resource, request.TestPermissionsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Policy responseCallSettings = await client.GetIamPolicyAsync(request.Project, request.Zone, request.Resource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - TestPermissionsResponse responseCancellationToken = await client.TestIamPermissionsAsync(request.Project, request.Zone, request.Resource, request.TestPermissionsRequestResource, st::CancellationToken.None); + Policy responseCancellationToken = await client.GetIamPolicyAsync(request.Project, request.Zone, request.Resource, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void UpdateRequestObject() + public void GetScreenshotRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateInstanceRequest request = new UpdateInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetScreenshotInstanceRequest request = new GetScreenshotInstanceRequest { Zone = "zone255f4ea8", Instance = "instance99a62371", - RequestId = "request_id362c8df6", - MostDisruptiveAllowedAction = "most_disruptive_allowed_actiondc81f7b0", - InstanceResource = new Instance(), Project = "projectaa6ff846", - MinimalAction = "minimal_action55009cd3", }; - Operation expectedResponse = new Operation + Screenshot expectedResponse = new Screenshot { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Contents = "contents8c7dbf98", }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetScreenshot(request, moq::It.IsAny())).Returns(expectedResponse); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request); + Screenshot response = client.GetScreenshot(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task UpdateRequestObjectAsync() + public async stt::Task GetScreenshotRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateInstanceRequest request = new UpdateInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetScreenshotInstanceRequest request = new GetScreenshotInstanceRequest { Zone = "zone255f4ea8", Instance = "instance99a62371", - RequestId = "request_id362c8df6", - MostDisruptiveAllowedAction = "most_disruptive_allowed_actiondc81f7b0", - InstanceResource = new Instance(), Project = "projectaa6ff846", - MinimalAction = "minimal_action55009cd3", }; - Operation expectedResponse = new Operation + Screenshot expectedResponse = new Screenshot { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Contents = "contents8c7dbf98", }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetScreenshotAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Screenshot responseCallSettings = await client.GetScreenshotAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request, st::CancellationToken.None); + Screenshot responseCancellationToken = await client.GetScreenshotAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void Update() + public void GetScreenshot() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateInstanceRequest request = new UpdateInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetScreenshotInstanceRequest request = new GetScreenshotInstanceRequest { Zone = "zone255f4ea8", Instance = "instance99a62371", - InstanceResource = new Instance(), Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + Screenshot expectedResponse = new Screenshot { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Contents = "contents8c7dbf98", }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetScreenshot(request, moq::It.IsAny())).Returns(expectedResponse); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request.Project, request.Zone, request.Instance, request.InstanceResource); + Screenshot response = client.GetScreenshot(request.Project, request.Zone, request.Instance); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task UpdateAsync() + public async stt::Task GetScreenshotAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateInstanceRequest request = new UpdateInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetScreenshotInstanceRequest request = new GetScreenshotInstanceRequest { Zone = "zone255f4ea8", Instance = "instance99a62371", - InstanceResource = new Instance(), Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + Screenshot expectedResponse = new Screenshot { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Contents = "contents8c7dbf98", }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetScreenshotAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request.Project, request.Zone, request.Instance, request.InstanceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Screenshot responseCallSettings = await client.GetScreenshotAsync(request.Project, request.Zone, request.Instance, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request.Project, request.Zone, request.Instance, request.InstanceResource, st::CancellationToken.None); + Screenshot responseCancellationToken = await client.GetScreenshotAsync(request.Project, request.Zone, request.Instance, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void UpdateAccessConfigRequestObject() + public void GetSerialPortOutputRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateAccessConfigInstanceRequest request = new UpdateAccessConfigInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetSerialPortOutputInstanceRequest request = new GetSerialPortOutputInstanceRequest { + Port = -78310000, Zone = "zone255f4ea8", Instance = "instance99a62371", - RequestId = "request_id362c8df6", + Start = -5616678393427383318L, Project = "projectaa6ff846", - NetworkInterface = "network_interfaceb50da44f", - AccessConfigResource = new AccessConfig(), }; - Operation expectedResponse = new Operation + SerialPortOutput expectedResponse = new SerialPortOutput { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + Next = 9139246809011047120L, + Start = -5616678393427383318L, SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Contents = "contents8c7dbf98", }; - mockGrpcClient.Setup(x => x.UpdateAccessConfig(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetSerialPortOutput(request, moq::It.IsAny())).Returns(expectedResponse); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.UpdateAccessConfig(request); + SerialPortOutput response = client.GetSerialPortOutput(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task UpdateAccessConfigRequestObjectAsync() + public async stt::Task GetSerialPortOutputRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateAccessConfigInstanceRequest request = new UpdateAccessConfigInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetSerialPortOutputInstanceRequest request = new GetSerialPortOutputInstanceRequest { + Port = -78310000, Zone = "zone255f4ea8", Instance = "instance99a62371", - RequestId = "request_id362c8df6", + Start = -5616678393427383318L, Project = "projectaa6ff846", - NetworkInterface = "network_interfaceb50da44f", - AccessConfigResource = new AccessConfig(), }; - Operation expectedResponse = new Operation + SerialPortOutput expectedResponse = new SerialPortOutput { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + Next = 9139246809011047120L, + Start = -5616678393427383318L, SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Contents = "contents8c7dbf98", }; - mockGrpcClient.Setup(x => x.UpdateAccessConfigAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetSerialPortOutputAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAccessConfigAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + SerialPortOutput responseCallSettings = await client.GetSerialPortOutputAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAccessConfigAsync(request, st::CancellationToken.None); + SerialPortOutput responseCancellationToken = await client.GetSerialPortOutputAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void UpdateAccessConfig() + public void GetSerialPortOutput() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateAccessConfigInstanceRequest request = new UpdateAccessConfigInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetSerialPortOutputInstanceRequest request = new GetSerialPortOutputInstanceRequest { Zone = "zone255f4ea8", Instance = "instance99a62371", Project = "projectaa6ff846", - NetworkInterface = "network_interfaceb50da44f", - AccessConfigResource = new AccessConfig(), }; - Operation expectedResponse = new Operation + SerialPortOutput expectedResponse = new SerialPortOutput { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + Kind = "kindf7aa39d9", + Next = 9139246809011047120L, + Start = -5616678393427383318L, SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Contents = "contents8c7dbf98", }; - mockGrpcClient.Setup(x => x.UpdateAccessConfig(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetSerialPortOutput(request, moq::It.IsAny())).Returns(expectedResponse); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.UpdateAccessConfig(request.Project, request.Zone, request.Instance, request.NetworkInterface, request.AccessConfigResource); + SerialPortOutput response = client.GetSerialPortOutput(request.Project, request.Zone, request.Instance); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task UpdateAccessConfigAsync() + public async stt::Task GetSerialPortOutputAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateAccessConfigInstanceRequest request = new UpdateAccessConfigInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetSerialPortOutputInstanceRequest request = new GetSerialPortOutputInstanceRequest { Zone = "zone255f4ea8", Instance = "instance99a62371", Project = "projectaa6ff846", - NetworkInterface = "network_interfaceb50da44f", - AccessConfigResource = new AccessConfig(), }; - Operation expectedResponse = new Operation + SerialPortOutput expectedResponse = new SerialPortOutput { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + Next = 9139246809011047120L, + Start = -5616678393427383318L, SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Contents = "contents8c7dbf98", }; - mockGrpcClient.Setup(x => x.UpdateAccessConfigAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetSerialPortOutputAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAccessConfigAsync(request.Project, request.Zone, request.Instance, request.NetworkInterface, request.AccessConfigResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + SerialPortOutput responseCallSettings = await client.GetSerialPortOutputAsync(request.Project, request.Zone, request.Instance, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAccessConfigAsync(request.Project, request.Zone, request.Instance, request.NetworkInterface, request.AccessConfigResource, st::CancellationToken.None); + SerialPortOutput responseCancellationToken = await client.GetSerialPortOutputAsync(request.Project, request.Zone, request.Instance, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void UpdateDisplayDeviceRequestObject() + public void GetShieldedInstanceIdentityRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateDisplayDeviceInstanceRequest request = new UpdateDisplayDeviceInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetShieldedInstanceIdentityInstanceRequest request = new GetShieldedInstanceIdentityInstanceRequest { Zone = "zone255f4ea8", Instance = "instance99a62371", - RequestId = "request_id362c8df6", Project = "projectaa6ff846", - DisplayDeviceResource = new DisplayDevice(), }; - Operation expectedResponse = new Operation + ShieldedInstanceIdentity expectedResponse = new ShieldedInstanceIdentity { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + SigningKey = new ShieldedInstanceIdentityEntry(), + EncryptionKey = new ShieldedInstanceIdentityEntry(), }; - mockGrpcClient.Setup(x => x.UpdateDisplayDevice(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetShieldedInstanceIdentity(request, moq::It.IsAny())).Returns(expectedResponse); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.UpdateDisplayDevice(request); + ShieldedInstanceIdentity response = client.GetShieldedInstanceIdentity(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task UpdateDisplayDeviceRequestObjectAsync() + public async stt::Task GetShieldedInstanceIdentityRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateDisplayDeviceInstanceRequest request = new UpdateDisplayDeviceInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetShieldedInstanceIdentityInstanceRequest request = new GetShieldedInstanceIdentityInstanceRequest { Zone = "zone255f4ea8", Instance = "instance99a62371", - RequestId = "request_id362c8df6", Project = "projectaa6ff846", - DisplayDeviceResource = new DisplayDevice(), }; - Operation expectedResponse = new Operation + ShieldedInstanceIdentity expectedResponse = new ShieldedInstanceIdentity { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + SigningKey = new ShieldedInstanceIdentityEntry(), + EncryptionKey = new ShieldedInstanceIdentityEntry(), }; - mockGrpcClient.Setup(x => x.UpdateDisplayDeviceAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetShieldedInstanceIdentityAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateDisplayDeviceAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + ShieldedInstanceIdentity responseCallSettings = await client.GetShieldedInstanceIdentityAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateDisplayDeviceAsync(request, st::CancellationToken.None); + ShieldedInstanceIdentity responseCancellationToken = await client.GetShieldedInstanceIdentityAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void UpdateDisplayDevice() + public void GetShieldedInstanceIdentity() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateDisplayDeviceInstanceRequest request = new UpdateDisplayDeviceInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetShieldedInstanceIdentityInstanceRequest request = new GetShieldedInstanceIdentityInstanceRequest { Zone = "zone255f4ea8", Instance = "instance99a62371", Project = "projectaa6ff846", - DisplayDeviceResource = new DisplayDevice(), }; - Operation expectedResponse = new Operation + ShieldedInstanceIdentity expectedResponse = new ShieldedInstanceIdentity { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + SigningKey = new ShieldedInstanceIdentityEntry(), + EncryptionKey = new ShieldedInstanceIdentityEntry(), }; - mockGrpcClient.Setup(x => x.UpdateDisplayDevice(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetShieldedInstanceIdentity(request, moq::It.IsAny())).Returns(expectedResponse); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.UpdateDisplayDevice(request.Project, request.Zone, request.Instance, request.DisplayDeviceResource); + ShieldedInstanceIdentity response = client.GetShieldedInstanceIdentity(request.Project, request.Zone, request.Instance); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task UpdateDisplayDeviceAsync() + public async stt::Task GetShieldedInstanceIdentityAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateDisplayDeviceInstanceRequest request = new UpdateDisplayDeviceInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetShieldedInstanceIdentityInstanceRequest request = new GetShieldedInstanceIdentityInstanceRequest { Zone = "zone255f4ea8", Instance = "instance99a62371", Project = "projectaa6ff846", - DisplayDeviceResource = new DisplayDevice(), }; - Operation expectedResponse = new Operation + ShieldedInstanceIdentity expectedResponse = new ShieldedInstanceIdentity { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + SigningKey = new ShieldedInstanceIdentityEntry(), + EncryptionKey = new ShieldedInstanceIdentityEntry(), }; - mockGrpcClient.Setup(x => x.UpdateDisplayDeviceAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetShieldedInstanceIdentityAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateDisplayDeviceAsync(request.Project, request.Zone, request.Instance, request.DisplayDeviceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + ShieldedInstanceIdentity responseCallSettings = await client.GetShieldedInstanceIdentityAsync(request.Project, request.Zone, request.Instance, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateDisplayDeviceAsync(request.Project, request.Zone, request.Instance, request.DisplayDeviceResource, st::CancellationToken.None); + ShieldedInstanceIdentity responseCancellationToken = await client.GetShieldedInstanceIdentityAsync(request.Project, request.Zone, request.Instance, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void UpdateNetworkInterfaceRequestObject() + public void SetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateNetworkInterfaceInstanceRequest request = new UpdateNetworkInterfaceInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + SetIamPolicyInstanceRequest request = new SetIamPolicyInstanceRequest { Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", + Resource = "resource164eab96", Project = "projectaa6ff846", - NetworkInterfaceResource = new NetworkInterface(), - NetworkInterface = "network_interfaceb50da44f", + ZoneSetPolicyRequestResource = new ZoneSetPolicyRequest(), }; - Operation expectedResponse = new Operation + Policy expectedResponse = new Policy { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.UpdateNetworkInterface(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.SetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.UpdateNetworkInterface(request); + Policy response = client.SetIamPolicy(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task UpdateNetworkInterfaceRequestObjectAsync() + public async stt::Task SetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateNetworkInterfaceInstanceRequest request = new UpdateNetworkInterfaceInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + SetIamPolicyInstanceRequest request = new SetIamPolicyInstanceRequest { Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", + Resource = "resource164eab96", Project = "projectaa6ff846", - NetworkInterfaceResource = new NetworkInterface(), - NetworkInterface = "network_interfaceb50da44f", + ZoneSetPolicyRequestResource = new ZoneSetPolicyRequest(), }; - Operation expectedResponse = new Operation + Policy expectedResponse = new Policy { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.UpdateNetworkInterfaceAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.SetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateNetworkInterfaceAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Policy responseCallSettings = await client.SetIamPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateNetworkInterfaceAsync(request, st::CancellationToken.None); + Policy responseCancellationToken = await client.SetIamPolicyAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void UpdateNetworkInterface() + public void SetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateNetworkInterfaceInstanceRequest request = new UpdateNetworkInterfaceInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + SetIamPolicyInstanceRequest request = new SetIamPolicyInstanceRequest { Zone = "zone255f4ea8", - Instance = "instance99a62371", + Resource = "resource164eab96", Project = "projectaa6ff846", - NetworkInterfaceResource = new NetworkInterface(), - NetworkInterface = "network_interfaceb50da44f", + ZoneSetPolicyRequestResource = new ZoneSetPolicyRequest(), }; - Operation expectedResponse = new Operation + Policy expectedResponse = new Policy { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.UpdateNetworkInterface(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.SetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.UpdateNetworkInterface(request.Project, request.Zone, request.Instance, request.NetworkInterface, request.NetworkInterfaceResource); + Policy response = client.SetIamPolicy(request.Project, request.Zone, request.Resource, request.ZoneSetPolicyRequestResource); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task UpdateNetworkInterfaceAsync() + public async stt::Task SetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateNetworkInterfaceInstanceRequest request = new UpdateNetworkInterfaceInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + SetIamPolicyInstanceRequest request = new SetIamPolicyInstanceRequest { Zone = "zone255f4ea8", - Instance = "instance99a62371", + Resource = "resource164eab96", Project = "projectaa6ff846", - NetworkInterfaceResource = new NetworkInterface(), - NetworkInterface = "network_interfaceb50da44f", + ZoneSetPolicyRequestResource = new ZoneSetPolicyRequest(), }; - Operation expectedResponse = new Operation + Policy expectedResponse = new Policy { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.UpdateNetworkInterfaceAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.SetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateNetworkInterfaceAsync(request.Project, request.Zone, request.Instance, request.NetworkInterface, request.NetworkInterfaceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Policy responseCallSettings = await client.SetIamPolicyAsync(request.Project, request.Zone, request.Resource, request.ZoneSetPolicyRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateNetworkInterfaceAsync(request.Project, request.Zone, request.Instance, request.NetworkInterface, request.NetworkInterfaceResource, st::CancellationToken.None); + Policy responseCancellationToken = await client.SetIamPolicyAsync(request.Project, request.Zone, request.Resource, request.ZoneSetPolicyRequestResource, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void UpdateShieldedInstanceConfigRequestObject() + public void TestIamPermissionsRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateShieldedInstanceConfigInstanceRequest request = new UpdateShieldedInstanceConfigInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + TestIamPermissionsInstanceRequest request = new TestIamPermissionsInstanceRequest { Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", + Resource = "resource164eab96", Project = "projectaa6ff846", - ShieldedInstanceConfigResource = new ShieldedInstanceConfig(), + TestPermissionsRequestResource = new TestPermissionsRequest(), }; - Operation expectedResponse = new Operation + TestPermissionsResponse expectedResponse = new TestPermissionsResponse { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Permissions = + { + "permissions535a2741", + }, }; - mockGrpcClient.Setup(x => x.UpdateShieldedInstanceConfig(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.TestIamPermissions(request, moq::It.IsAny())).Returns(expectedResponse); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.UpdateShieldedInstanceConfig(request); + TestPermissionsResponse response = client.TestIamPermissions(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task UpdateShieldedInstanceConfigRequestObjectAsync() + public async stt::Task TestIamPermissionsRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateShieldedInstanceConfigInstanceRequest request = new UpdateShieldedInstanceConfigInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + TestIamPermissionsInstanceRequest request = new TestIamPermissionsInstanceRequest { Zone = "zone255f4ea8", - Instance = "instance99a62371", - RequestId = "request_id362c8df6", + Resource = "resource164eab96", Project = "projectaa6ff846", - ShieldedInstanceConfigResource = new ShieldedInstanceConfig(), + TestPermissionsRequestResource = new TestPermissionsRequest(), }; - Operation expectedResponse = new Operation + TestPermissionsResponse expectedResponse = new TestPermissionsResponse { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Permissions = + { + "permissions535a2741", + }, }; - mockGrpcClient.Setup(x => x.UpdateShieldedInstanceConfigAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.TestIamPermissionsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateShieldedInstanceConfigAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + TestPermissionsResponse responseCallSettings = await client.TestIamPermissionsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateShieldedInstanceConfigAsync(request, st::CancellationToken.None); + TestPermissionsResponse responseCancellationToken = await client.TestIamPermissionsAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void UpdateShieldedInstanceConfig() + public void TestIamPermissions() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateShieldedInstanceConfigInstanceRequest request = new UpdateShieldedInstanceConfigInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + TestIamPermissionsInstanceRequest request = new TestIamPermissionsInstanceRequest { Zone = "zone255f4ea8", - Instance = "instance99a62371", + Resource = "resource164eab96", Project = "projectaa6ff846", - ShieldedInstanceConfigResource = new ShieldedInstanceConfig(), + TestPermissionsRequestResource = new TestPermissionsRequest(), }; - Operation expectedResponse = new Operation + TestPermissionsResponse expectedResponse = new TestPermissionsResponse { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Permissions = + { + "permissions535a2741", + }, }; - mockGrpcClient.Setup(x => x.UpdateShieldedInstanceConfig(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.TestIamPermissions(request, moq::It.IsAny())).Returns(expectedResponse); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.UpdateShieldedInstanceConfig(request.Project, request.Zone, request.Instance, request.ShieldedInstanceConfigResource); + TestPermissionsResponse response = client.TestIamPermissions(request.Project, request.Zone, request.Resource, request.TestPermissionsRequestResource); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task UpdateShieldedInstanceConfigAsync() + public async stt::Task TestIamPermissionsAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateShieldedInstanceConfigInstanceRequest request = new UpdateShieldedInstanceConfigInstanceRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + TestIamPermissionsInstanceRequest request = new TestIamPermissionsInstanceRequest { Zone = "zone255f4ea8", - Instance = "instance99a62371", + Resource = "resource164eab96", Project = "projectaa6ff846", - ShieldedInstanceConfigResource = new ShieldedInstanceConfig(), + TestPermissionsRequestResource = new TestPermissionsRequest(), }; - Operation expectedResponse = new Operation + TestPermissionsResponse expectedResponse = new TestPermissionsResponse { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Permissions = + { + "permissions535a2741", + }, }; - mockGrpcClient.Setup(x => x.UpdateShieldedInstanceConfigAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.TestIamPermissionsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); InstancesClient client = new InstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateShieldedInstanceConfigAsync(request.Project, request.Zone, request.Instance, request.ShieldedInstanceConfigResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + TestPermissionsResponse responseCallSettings = await client.TestIamPermissionsAsync(request.Project, request.Zone, request.Resource, request.TestPermissionsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateShieldedInstanceConfigAsync(request.Project, request.Zone, request.Instance, request.ShieldedInstanceConfigResource, st::CancellationToken.None); + TestPermissionsResponse responseCancellationToken = await client.TestIamPermissionsAsync(request.Project, request.Zone, request.Resource, request.TestPermissionsRequestResource, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InterconnectAttachmentsClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InterconnectAttachmentsClientTest.g.cs index d10e144af397..c76989d9e412 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InterconnectAttachmentsClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InterconnectAttachmentsClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedInterconnectAttachmentsClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInterconnectAttachmentRequest request = new DeleteInterconnectAttachmentRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - InterconnectAttachment = "interconnect_attachmentc83a7a7c", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - InterconnectAttachmentsClient client = new InterconnectAttachmentsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInterconnectAttachmentRequest request = new DeleteInterconnectAttachmentRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - InterconnectAttachment = "interconnect_attachmentc83a7a7c", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InterconnectAttachmentsClient client = new InterconnectAttachmentsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInterconnectAttachmentRequest request = new DeleteInterconnectAttachmentRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - InterconnectAttachment = "interconnect_attachmentc83a7a7c", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - InterconnectAttachmentsClient client = new InterconnectAttachmentsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.InterconnectAttachment); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInterconnectAttachmentRequest request = new DeleteInterconnectAttachmentRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - InterconnectAttachment = "interconnect_attachmentc83a7a7c", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InterconnectAttachmentsClient client = new InterconnectAttachmentsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.InterconnectAttachment, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.InterconnectAttachment, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetInterconnectAttachmentRequest request = new GetInterconnectAttachmentRequest { Region = "regionedb20d96", @@ -266,6 +86,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetInterconnectAttachmentRequest request = new GetInterconnectAttachmentRequest { Region = "regionedb20d96", @@ -322,6 +143,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetInterconnectAttachmentRequest request = new GetInterconnectAttachmentRequest { Region = "regionedb20d96", @@ -376,6 +198,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetInterconnectAttachmentRequest request = new GetInterconnectAttachmentRequest { Region = "regionedb20d96", @@ -427,375 +250,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInterconnectAttachmentRequest request = new InsertInterconnectAttachmentRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - InterconnectAttachmentResource = new InterconnectAttachment(), - Project = "projectaa6ff846", - ValidateOnly = true, - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - InterconnectAttachmentsClient client = new InterconnectAttachmentsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInterconnectAttachmentRequest request = new InsertInterconnectAttachmentRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - InterconnectAttachmentResource = new InterconnectAttachment(), - Project = "projectaa6ff846", - ValidateOnly = true, - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InterconnectAttachmentsClient client = new InterconnectAttachmentsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInterconnectAttachmentRequest request = new InsertInterconnectAttachmentRequest - { - Region = "regionedb20d96", - InterconnectAttachmentResource = new InterconnectAttachment(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - InterconnectAttachmentsClient client = new InterconnectAttachmentsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.InterconnectAttachmentResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInterconnectAttachmentRequest request = new InsertInterconnectAttachmentRequest - { - Region = "regionedb20d96", - InterconnectAttachmentResource = new InterconnectAttachment(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InterconnectAttachmentsClient client = new InterconnectAttachmentsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.InterconnectAttachmentResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.InterconnectAttachmentResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchInterconnectAttachmentRequest request = new PatchInterconnectAttachmentRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - InterconnectAttachmentResource = new InterconnectAttachment(), - Project = "projectaa6ff846", - InterconnectAttachment = "interconnect_attachmentc83a7a7c", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - InterconnectAttachmentsClient client = new InterconnectAttachmentsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchInterconnectAttachmentRequest request = new PatchInterconnectAttachmentRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - InterconnectAttachmentResource = new InterconnectAttachment(), - Project = "projectaa6ff846", - InterconnectAttachment = "interconnect_attachmentc83a7a7c", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InterconnectAttachmentsClient client = new InterconnectAttachmentsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchInterconnectAttachmentRequest request = new PatchInterconnectAttachmentRequest - { - Region = "regionedb20d96", - InterconnectAttachmentResource = new InterconnectAttachment(), - Project = "projectaa6ff846", - InterconnectAttachment = "interconnect_attachmentc83a7a7c", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - InterconnectAttachmentsClient client = new InterconnectAttachmentsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.Region, request.InterconnectAttachment, request.InterconnectAttachmentResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchInterconnectAttachmentRequest request = new PatchInterconnectAttachmentRequest - { - Region = "regionedb20d96", - InterconnectAttachmentResource = new InterconnectAttachment(), - Project = "projectaa6ff846", - InterconnectAttachment = "interconnect_attachmentc83a7a7c", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InterconnectAttachmentsClient client = new InterconnectAttachmentsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.Region, request.InterconnectAttachment, request.InterconnectAttachmentResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.Region, request.InterconnectAttachment, request.InterconnectAttachmentResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InterconnectsClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InterconnectsClientTest.g.cs index 63d5c4d51296..ccd156ece7ce 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InterconnectsClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/InterconnectsClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,188 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedInterconnectsClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInterconnectRequest request = new DeleteInterconnectRequest - { - RequestId = "request_id362c8df6", - Interconnect = "interconnect253e8bf5", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - InterconnectsClient client = new InterconnectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInterconnectRequest request = new DeleteInterconnectRequest - { - RequestId = "request_id362c8df6", - Interconnect = "interconnect253e8bf5", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InterconnectsClient client = new InterconnectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInterconnectRequest request = new DeleteInterconnectRequest - { - Interconnect = "interconnect253e8bf5", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - InterconnectsClient client = new InterconnectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Interconnect); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInterconnectRequest request = new DeleteInterconnectRequest - { - Interconnect = "interconnect253e8bf5", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InterconnectsClient client = new InterconnectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Interconnect, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Interconnect, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetInterconnectRequest request = new GetInterconnectRequest { Interconnect = "interconnect253e8bf5", @@ -258,6 +82,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetInterconnectRequest request = new GetInterconnectRequest { Interconnect = "interconnect253e8bf5", @@ -310,6 +135,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetInterconnectRequest request = new GetInterconnectRequest { Interconnect = "interconnect253e8bf5", @@ -360,6 +186,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetInterconnectRequest request = new GetInterconnectRequest { Interconnect = "interconnect253e8bf5", @@ -412,6 +239,7 @@ public void Get() public void GetDiagnosticsRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetDiagnosticsInterconnectRequest request = new GetDiagnosticsInterconnectRequest { Interconnect = "interconnect253e8bf5", @@ -432,6 +260,7 @@ public void GetDiagnosticsRequestObject() public async stt::Task GetDiagnosticsRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetDiagnosticsInterconnectRequest request = new GetDiagnosticsInterconnectRequest { Interconnect = "interconnect253e8bf5", @@ -454,6 +283,7 @@ public void GetDiagnosticsRequestObject() public void GetDiagnostics() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetDiagnosticsInterconnectRequest request = new GetDiagnosticsInterconnectRequest { Interconnect = "interconnect253e8bf5", @@ -474,6 +304,7 @@ public void GetDiagnostics() public async stt::Task GetDiagnosticsAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetDiagnosticsInterconnectRequest request = new GetDiagnosticsInterconnectRequest { Interconnect = "interconnect253e8bf5", @@ -491,365 +322,5 @@ public void GetDiagnostics() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInterconnectRequest request = new InsertInterconnectRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InterconnectResource = new Interconnect(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - InterconnectsClient client = new InterconnectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInterconnectRequest request = new InsertInterconnectRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InterconnectResource = new Interconnect(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InterconnectsClient client = new InterconnectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInterconnectRequest request = new InsertInterconnectRequest - { - Project = "projectaa6ff846", - InterconnectResource = new Interconnect(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - InterconnectsClient client = new InterconnectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.InterconnectResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertInterconnectRequest request = new InsertInterconnectRequest - { - Project = "projectaa6ff846", - InterconnectResource = new Interconnect(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InterconnectsClient client = new InterconnectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.InterconnectResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.InterconnectResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchInterconnectRequest request = new PatchInterconnectRequest - { - RequestId = "request_id362c8df6", - Interconnect = "interconnect253e8bf5", - Project = "projectaa6ff846", - InterconnectResource = new Interconnect(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - InterconnectsClient client = new InterconnectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchInterconnectRequest request = new PatchInterconnectRequest - { - RequestId = "request_id362c8df6", - Interconnect = "interconnect253e8bf5", - Project = "projectaa6ff846", - InterconnectResource = new Interconnect(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InterconnectsClient client = new InterconnectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchInterconnectRequest request = new PatchInterconnectRequest - { - Interconnect = "interconnect253e8bf5", - Project = "projectaa6ff846", - InterconnectResource = new Interconnect(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - InterconnectsClient client = new InterconnectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.Interconnect, request.InterconnectResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchInterconnectRequest request = new PatchInterconnectRequest - { - Interconnect = "interconnect253e8bf5", - Project = "projectaa6ff846", - InterconnectResource = new Interconnect(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - InterconnectsClient client = new InterconnectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.Interconnect, request.InterconnectResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.Interconnect, request.InterconnectResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/LicensesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/LicensesClientTest.g.cs index e0d164a1fc41..0e86d9024063 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/LicensesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/LicensesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,188 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedLicensesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteLicenseRequest request = new DeleteLicenseRequest - { - RequestId = "request_id362c8df6", - License = "license75798771", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - LicensesClient client = new LicensesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteLicenseRequest request = new DeleteLicenseRequest - { - RequestId = "request_id362c8df6", - License = "license75798771", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - LicensesClient client = new LicensesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteLicenseRequest request = new DeleteLicenseRequest - { - License = "license75798771", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - LicensesClient client = new LicensesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.License); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteLicenseRequest request = new DeleteLicenseRequest - { - License = "license75798771", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - LicensesClient client = new LicensesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.License, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.License, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetLicenseRequest request = new GetLicenseRequest { License = "license75798771", @@ -237,6 +61,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetLicenseRequest request = new GetLicenseRequest { License = "license75798771", @@ -268,6 +93,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetLicenseRequest request = new GetLicenseRequest { License = "license75798771", @@ -297,6 +123,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetLicenseRequest request = new GetLicenseRequest { License = "license75798771", @@ -328,6 +155,7 @@ public void Get() public void GetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetIamPolicyLicenseRequest request = new GetIamPolicyLicenseRequest { Resource = "resource164eab96", @@ -354,6 +182,7 @@ public void GetIamPolicyRequestObject() public async stt::Task GetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetIamPolicyLicenseRequest request = new GetIamPolicyLicenseRequest { Resource = "resource164eab96", @@ -382,6 +211,7 @@ public void GetIamPolicyRequestObject() public void GetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetIamPolicyLicenseRequest request = new GetIamPolicyLicenseRequest { Resource = "resource164eab96", @@ -407,6 +237,7 @@ public void GetIamPolicy() public async stt::Task GetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetIamPolicyLicenseRequest request = new GetIamPolicyLicenseRequest { Resource = "resource164eab96", @@ -430,188 +261,11 @@ public void GetIamPolicy() mockGrpcClient.VerifyAll(); } - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertLicenseRequest request = new InsertLicenseRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - LicenseResource = new License(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - LicensesClient client = new LicensesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertLicenseRequest request = new InsertLicenseRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - LicenseResource = new License(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - LicensesClient client = new LicensesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertLicenseRequest request = new InsertLicenseRequest - { - Project = "projectaa6ff846", - LicenseResource = new License(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - LicensesClient client = new LicensesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.LicenseResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertLicenseRequest request = new InsertLicenseRequest - { - Project = "projectaa6ff846", - LicenseResource = new License(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - LicensesClient client = new LicensesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.LicenseResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.LicenseResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void SetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); SetIamPolicyLicenseRequest request = new SetIamPolicyLicenseRequest { Resource = "resource164eab96", @@ -638,6 +292,7 @@ public void SetIamPolicyRequestObject() public async stt::Task SetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); SetIamPolicyLicenseRequest request = new SetIamPolicyLicenseRequest { Resource = "resource164eab96", @@ -666,6 +321,7 @@ public void SetIamPolicyRequestObject() public void SetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); SetIamPolicyLicenseRequest request = new SetIamPolicyLicenseRequest { Resource = "resource164eab96", @@ -692,6 +348,7 @@ public void SetIamPolicy() public async stt::Task SetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); SetIamPolicyLicenseRequest request = new SetIamPolicyLicenseRequest { Resource = "resource164eab96", @@ -720,6 +377,7 @@ public void SetIamPolicy() public void TestIamPermissionsRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); TestIamPermissionsLicenseRequest request = new TestIamPermissionsLicenseRequest { Resource = "resource164eab96", @@ -744,6 +402,7 @@ public void TestIamPermissionsRequestObject() public async stt::Task TestIamPermissionsRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); TestIamPermissionsLicenseRequest request = new TestIamPermissionsLicenseRequest { Resource = "resource164eab96", @@ -770,6 +429,7 @@ public void TestIamPermissionsRequestObject() public void TestIamPermissions() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); TestIamPermissionsLicenseRequest request = new TestIamPermissionsLicenseRequest { Resource = "resource164eab96", @@ -794,6 +454,7 @@ public void TestIamPermissions() public async stt::Task TestIamPermissionsAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); TestIamPermissionsLicenseRequest request = new TestIamPermissionsLicenseRequest { Resource = "resource164eab96", diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/NetworkEndpointGroupsClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/NetworkEndpointGroupsClientTest.g.cs index 77575da5e262..9186c9050e1b 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/NetworkEndpointGroupsClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/NetworkEndpointGroupsClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,564 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedNetworkEndpointGroupsClientTest { - [xunit::FactAttribute] - public void AttachNetworkEndpointsRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AttachNetworkEndpointsNetworkEndpointGroupRequest request = new AttachNetworkEndpointsNetworkEndpointGroupRequest - { - NetworkEndpointGroupsAttachEndpointsRequestResource = new NetworkEndpointGroupsAttachEndpointsRequest(), - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AttachNetworkEndpoints(request, moq::It.IsAny())).Returns(expectedResponse); - NetworkEndpointGroupsClient client = new NetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.AttachNetworkEndpoints(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AttachNetworkEndpointsRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AttachNetworkEndpointsNetworkEndpointGroupRequest request = new AttachNetworkEndpointsNetworkEndpointGroupRequest - { - NetworkEndpointGroupsAttachEndpointsRequestResource = new NetworkEndpointGroupsAttachEndpointsRequest(), - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AttachNetworkEndpointsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NetworkEndpointGroupsClient client = new NetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AttachNetworkEndpointsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AttachNetworkEndpointsAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void AttachNetworkEndpoints() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AttachNetworkEndpointsNetworkEndpointGroupRequest request = new AttachNetworkEndpointsNetworkEndpointGroupRequest - { - NetworkEndpointGroupsAttachEndpointsRequestResource = new NetworkEndpointGroupsAttachEndpointsRequest(), - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AttachNetworkEndpoints(request, moq::It.IsAny())).Returns(expectedResponse); - NetworkEndpointGroupsClient client = new NetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.AttachNetworkEndpoints(request.Project, request.Zone, request.NetworkEndpointGroup, request.NetworkEndpointGroupsAttachEndpointsRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AttachNetworkEndpointsAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AttachNetworkEndpointsNetworkEndpointGroupRequest request = new AttachNetworkEndpointsNetworkEndpointGroupRequest - { - NetworkEndpointGroupsAttachEndpointsRequestResource = new NetworkEndpointGroupsAttachEndpointsRequest(), - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AttachNetworkEndpointsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NetworkEndpointGroupsClient client = new NetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AttachNetworkEndpointsAsync(request.Project, request.Zone, request.NetworkEndpointGroup, request.NetworkEndpointGroupsAttachEndpointsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AttachNetworkEndpointsAsync(request.Project, request.Zone, request.NetworkEndpointGroup, request.NetworkEndpointGroupsAttachEndpointsRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteNetworkEndpointGroupRequest request = new DeleteNetworkEndpointGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - NetworkEndpointGroupsClient client = new NetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteNetworkEndpointGroupRequest request = new DeleteNetworkEndpointGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NetworkEndpointGroupsClient client = new NetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteNetworkEndpointGroupRequest request = new DeleteNetworkEndpointGroupRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - NetworkEndpointGroupsClient client = new NetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Zone, request.NetworkEndpointGroup); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteNetworkEndpointGroupRequest request = new DeleteNetworkEndpointGroupRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NetworkEndpointGroupsClient client = new NetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Zone, request.NetworkEndpointGroup, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Zone, request.NetworkEndpointGroup, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DetachNetworkEndpointsRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DetachNetworkEndpointsNetworkEndpointGroupRequest request = new DetachNetworkEndpointsNetworkEndpointGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - NetworkEndpointGroupsDetachEndpointsRequestResource = new NetworkEndpointGroupsDetachEndpointsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DetachNetworkEndpoints(request, moq::It.IsAny())).Returns(expectedResponse); - NetworkEndpointGroupsClient client = new NetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.DetachNetworkEndpoints(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DetachNetworkEndpointsRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DetachNetworkEndpointsNetworkEndpointGroupRequest request = new DetachNetworkEndpointsNetworkEndpointGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - NetworkEndpointGroupsDetachEndpointsRequestResource = new NetworkEndpointGroupsDetachEndpointsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DetachNetworkEndpointsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NetworkEndpointGroupsClient client = new NetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DetachNetworkEndpointsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DetachNetworkEndpointsAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DetachNetworkEndpoints() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DetachNetworkEndpointsNetworkEndpointGroupRequest request = new DetachNetworkEndpointsNetworkEndpointGroupRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - NetworkEndpointGroupsDetachEndpointsRequestResource = new NetworkEndpointGroupsDetachEndpointsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DetachNetworkEndpoints(request, moq::It.IsAny())).Returns(expectedResponse); - NetworkEndpointGroupsClient client = new NetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.DetachNetworkEndpoints(request.Project, request.Zone, request.NetworkEndpointGroup, request.NetworkEndpointGroupsDetachEndpointsRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DetachNetworkEndpointsAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DetachNetworkEndpointsNetworkEndpointGroupRequest request = new DetachNetworkEndpointsNetworkEndpointGroupRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - NetworkEndpointGroupsDetachEndpointsRequestResource = new NetworkEndpointGroupsDetachEndpointsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DetachNetworkEndpointsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NetworkEndpointGroupsClient client = new NetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DetachNetworkEndpointsAsync(request.Project, request.Zone, request.NetworkEndpointGroup, request.NetworkEndpointGroupsDetachEndpointsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DetachNetworkEndpointsAsync(request.Project, request.Zone, request.NetworkEndpointGroup, request.NetworkEndpointGroupsDetachEndpointsRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetNetworkEndpointGroupRequest request = new GetNetworkEndpointGroupRequest { Zone = "zone255f4ea8", @@ -627,6 +75,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetNetworkEndpointGroupRequest request = new GetNetworkEndpointGroupRequest { Zone = "zone255f4ea8", @@ -672,6 +121,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetNetworkEndpointGroupRequest request = new GetNetworkEndpointGroupRequest { Zone = "zone255f4ea8", @@ -715,6 +165,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetNetworkEndpointGroupRequest request = new GetNetworkEndpointGroupRequest { Zone = "zone255f4ea8", @@ -756,192 +207,11 @@ public void Get() mockGrpcClient.VerifyAll(); } - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertNetworkEndpointGroupRequest request = new InsertNetworkEndpointGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - NetworkEndpointGroupResource = new NetworkEndpointGroup(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - NetworkEndpointGroupsClient client = new NetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertNetworkEndpointGroupRequest request = new InsertNetworkEndpointGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - NetworkEndpointGroupResource = new NetworkEndpointGroup(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NetworkEndpointGroupsClient client = new NetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertNetworkEndpointGroupRequest request = new InsertNetworkEndpointGroupRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - NetworkEndpointGroupResource = new NetworkEndpointGroup(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - NetworkEndpointGroupsClient client = new NetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Zone, request.NetworkEndpointGroupResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertNetworkEndpointGroupRequest request = new InsertNetworkEndpointGroupRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - NetworkEndpointGroupResource = new NetworkEndpointGroup(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NetworkEndpointGroupsClient client = new NetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Zone, request.NetworkEndpointGroupResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Zone, request.NetworkEndpointGroupResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void TestIamPermissionsRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); TestIamPermissionsNetworkEndpointGroupRequest request = new TestIamPermissionsNetworkEndpointGroupRequest { Zone = "zone255f4ea8", @@ -967,6 +237,7 @@ public void TestIamPermissionsRequestObject() public async stt::Task TestIamPermissionsRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); TestIamPermissionsNetworkEndpointGroupRequest request = new TestIamPermissionsNetworkEndpointGroupRequest { Zone = "zone255f4ea8", @@ -994,6 +265,7 @@ public void TestIamPermissionsRequestObject() public void TestIamPermissions() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); TestIamPermissionsNetworkEndpointGroupRequest request = new TestIamPermissionsNetworkEndpointGroupRequest { Zone = "zone255f4ea8", @@ -1019,6 +291,7 @@ public void TestIamPermissions() public async stt::Task TestIamPermissionsAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); TestIamPermissionsNetworkEndpointGroupRequest request = new TestIamPermissionsNetworkEndpointGroupRequest { Zone = "zone255f4ea8", diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/NetworksClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/NetworksClientTest.g.cs index d7e41162adcb..d3249cb3accd 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/NetworksClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/NetworksClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,370 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedNetworksClientTest { - [xunit::FactAttribute] - public void AddPeeringRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddPeeringNetworkRequest request = new AddPeeringNetworkRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - Network = "networkd22ce091", - NetworksAddPeeringRequestResource = new NetworksAddPeeringRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddPeering(request, moq::It.IsAny())).Returns(expectedResponse); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddPeering(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddPeeringRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddPeeringNetworkRequest request = new AddPeeringNetworkRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - Network = "networkd22ce091", - NetworksAddPeeringRequestResource = new NetworksAddPeeringRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddPeeringAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddPeeringAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddPeeringAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void AddPeering() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddPeeringNetworkRequest request = new AddPeeringNetworkRequest - { - Project = "projectaa6ff846", - Network = "networkd22ce091", - NetworksAddPeeringRequestResource = new NetworksAddPeeringRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddPeering(request, moq::It.IsAny())).Returns(expectedResponse); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddPeering(request.Project, request.Network, request.NetworksAddPeeringRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddPeeringAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddPeeringNetworkRequest request = new AddPeeringNetworkRequest - { - Project = "projectaa6ff846", - Network = "networkd22ce091", - NetworksAddPeeringRequestResource = new NetworksAddPeeringRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddPeeringAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddPeeringAsync(request.Project, request.Network, request.NetworksAddPeeringRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddPeeringAsync(request.Project, request.Network, request.NetworksAddPeeringRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteNetworkRequest request = new DeleteNetworkRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - Network = "networkd22ce091", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteNetworkRequest request = new DeleteNetworkRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - Network = "networkd22ce091", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteNetworkRequest request = new DeleteNetworkRequest - { - Project = "projectaa6ff846", - Network = "networkd22ce091", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Network); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteNetworkRequest request = new DeleteNetworkRequest - { - Project = "projectaa6ff846", - Network = "networkd22ce091", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Network, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Network, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetNetworkRequest request = new GetNetworkRequest { Project = "projectaa6ff846", @@ -428,6 +70,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetNetworkRequest request = new GetNetworkRequest { Project = "projectaa6ff846", @@ -468,6 +111,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetNetworkRequest request = new GetNetworkRequest { Project = "projectaa6ff846", @@ -506,6 +150,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetNetworkRequest request = new GetNetworkRequest { Project = "projectaa6ff846", @@ -546,6 +191,7 @@ public void Get() public void GetEffectiveFirewallsRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetEffectiveFirewallsNetworkRequest request = new GetEffectiveFirewallsNetworkRequest { Project = "projectaa6ff846", @@ -570,6 +216,7 @@ public void GetEffectiveFirewallsRequestObject() public async stt::Task GetEffectiveFirewallsRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetEffectiveFirewallsNetworkRequest request = new GetEffectiveFirewallsNetworkRequest { Project = "projectaa6ff846", @@ -596,6 +243,7 @@ public void GetEffectiveFirewallsRequestObject() public void GetEffectiveFirewalls() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetEffectiveFirewallsNetworkRequest request = new GetEffectiveFirewallsNetworkRequest { Project = "projectaa6ff846", @@ -620,6 +268,7 @@ public void GetEffectiveFirewalls() public async stt::Task GetEffectiveFirewallsAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetEffectiveFirewallsNetworkRequest request = new GetEffectiveFirewallsNetworkRequest { Project = "projectaa6ff846", @@ -641,907 +290,5 @@ public void GetEffectiveFirewalls() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertNetworkRequest request = new InsertNetworkRequest - { - RequestId = "request_id362c8df6", - NetworkResource = new Network(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertNetworkRequest request = new InsertNetworkRequest - { - RequestId = "request_id362c8df6", - NetworkResource = new Network(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertNetworkRequest request = new InsertNetworkRequest - { - NetworkResource = new Network(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.NetworkResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertNetworkRequest request = new InsertNetworkRequest - { - NetworkResource = new Network(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.NetworkResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.NetworkResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchNetworkRequest request = new PatchNetworkRequest - { - RequestId = "request_id362c8df6", - NetworkResource = new Network(), - Project = "projectaa6ff846", - Network = "networkd22ce091", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchNetworkRequest request = new PatchNetworkRequest - { - RequestId = "request_id362c8df6", - NetworkResource = new Network(), - Project = "projectaa6ff846", - Network = "networkd22ce091", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchNetworkRequest request = new PatchNetworkRequest - { - NetworkResource = new Network(), - Project = "projectaa6ff846", - Network = "networkd22ce091", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.Network, request.NetworkResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchNetworkRequest request = new PatchNetworkRequest - { - NetworkResource = new Network(), - Project = "projectaa6ff846", - Network = "networkd22ce091", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.Network, request.NetworkResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.Network, request.NetworkResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void RemovePeeringRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemovePeeringNetworkRequest request = new RemovePeeringNetworkRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - Network = "networkd22ce091", - NetworksRemovePeeringRequestResource = new NetworksRemovePeeringRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemovePeering(request, moq::It.IsAny())).Returns(expectedResponse); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.RemovePeering(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task RemovePeeringRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemovePeeringNetworkRequest request = new RemovePeeringNetworkRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - Network = "networkd22ce091", - NetworksRemovePeeringRequestResource = new NetworksRemovePeeringRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemovePeeringAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RemovePeeringAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RemovePeeringAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void RemovePeering() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemovePeeringNetworkRequest request = new RemovePeeringNetworkRequest - { - Project = "projectaa6ff846", - Network = "networkd22ce091", - NetworksRemovePeeringRequestResource = new NetworksRemovePeeringRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemovePeering(request, moq::It.IsAny())).Returns(expectedResponse); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.RemovePeering(request.Project, request.Network, request.NetworksRemovePeeringRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task RemovePeeringAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemovePeeringNetworkRequest request = new RemovePeeringNetworkRequest - { - Project = "projectaa6ff846", - Network = "networkd22ce091", - NetworksRemovePeeringRequestResource = new NetworksRemovePeeringRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemovePeeringAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RemovePeeringAsync(request.Project, request.Network, request.NetworksRemovePeeringRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RemovePeeringAsync(request.Project, request.Network, request.NetworksRemovePeeringRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SwitchToCustomModeRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SwitchToCustomModeNetworkRequest request = new SwitchToCustomModeNetworkRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - Network = "networkd22ce091", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SwitchToCustomMode(request, moq::It.IsAny())).Returns(expectedResponse); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.SwitchToCustomMode(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SwitchToCustomModeRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SwitchToCustomModeNetworkRequest request = new SwitchToCustomModeNetworkRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - Network = "networkd22ce091", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SwitchToCustomModeAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SwitchToCustomModeAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SwitchToCustomModeAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SwitchToCustomMode() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SwitchToCustomModeNetworkRequest request = new SwitchToCustomModeNetworkRequest - { - Project = "projectaa6ff846", - Network = "networkd22ce091", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SwitchToCustomMode(request, moq::It.IsAny())).Returns(expectedResponse); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.SwitchToCustomMode(request.Project, request.Network); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SwitchToCustomModeAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SwitchToCustomModeNetworkRequest request = new SwitchToCustomModeNetworkRequest - { - Project = "projectaa6ff846", - Network = "networkd22ce091", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SwitchToCustomModeAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SwitchToCustomModeAsync(request.Project, request.Network, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SwitchToCustomModeAsync(request.Project, request.Network, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void UpdatePeeringRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdatePeeringNetworkRequest request = new UpdatePeeringNetworkRequest - { - RequestId = "request_id362c8df6", - NetworksUpdatePeeringRequestResource = new NetworksUpdatePeeringRequest(), - Project = "projectaa6ff846", - Network = "networkd22ce091", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdatePeering(request, moq::It.IsAny())).Returns(expectedResponse); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.UpdatePeering(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task UpdatePeeringRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdatePeeringNetworkRequest request = new UpdatePeeringNetworkRequest - { - RequestId = "request_id362c8df6", - NetworksUpdatePeeringRequestResource = new NetworksUpdatePeeringRequest(), - Project = "projectaa6ff846", - Network = "networkd22ce091", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdatePeeringAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdatePeeringAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdatePeeringAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void UpdatePeering() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdatePeeringNetworkRequest request = new UpdatePeeringNetworkRequest - { - NetworksUpdatePeeringRequestResource = new NetworksUpdatePeeringRequest(), - Project = "projectaa6ff846", - Network = "networkd22ce091", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdatePeering(request, moq::It.IsAny())).Returns(expectedResponse); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.UpdatePeering(request.Project, request.Network, request.NetworksUpdatePeeringRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task UpdatePeeringAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdatePeeringNetworkRequest request = new UpdatePeeringNetworkRequest - { - NetworksUpdatePeeringRequestResource = new NetworksUpdatePeeringRequest(), - Project = "projectaa6ff846", - Network = "networkd22ce091", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdatePeeringAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NetworksClient client = new NetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdatePeeringAsync(request.Project, request.Network, request.NetworksUpdatePeeringRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdatePeeringAsync(request.Project, request.Network, request.NetworksUpdatePeeringRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/NodeGroupsClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/NodeGroupsClientTest.g.cs index 1273dd73dff9..59d8500d72a6 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/NodeGroupsClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/NodeGroupsClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -27,1181 +28,263 @@ namespace Google.Cloud.Compute.V1.Tests public sealed class GeneratedNodeGroupsClientTest { [xunit::FactAttribute] - public void AddNodesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddNodesNodeGroupRequest request = new AddNodesNodeGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - NodeGroupsAddNodesRequestResource = new NodeGroupsAddNodesRequest(), - Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddNodes(request, moq::It.IsAny())).Returns(expectedResponse); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddNodes(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddNodesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddNodesNodeGroupRequest request = new AddNodesNodeGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - NodeGroupsAddNodesRequestResource = new NodeGroupsAddNodesRequest(), - Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddNodesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddNodesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddNodesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void AddNodes() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddNodesNodeGroupRequest request = new AddNodesNodeGroupRequest - { - Zone = "zone255f4ea8", - NodeGroupsAddNodesRequestResource = new NodeGroupsAddNodesRequest(), - Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddNodes(request, moq::It.IsAny())).Returns(expectedResponse); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddNodes(request.Project, request.Zone, request.NodeGroup, request.NodeGroupsAddNodesRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddNodesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddNodesNodeGroupRequest request = new AddNodesNodeGroupRequest - { - Zone = "zone255f4ea8", - NodeGroupsAddNodesRequestResource = new NodeGroupsAddNodesRequest(), - Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddNodesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddNodesAsync(request.Project, request.Zone, request.NodeGroup, request.NodeGroupsAddNodesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddNodesAsync(request.Project, request.Zone, request.NodeGroup, request.NodeGroupsAddNodesRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteNodeGroupRequest request = new DeleteNodeGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteNodeGroupRequest request = new DeleteNodeGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteNodeGroupRequest request = new DeleteNodeGroupRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Zone, request.NodeGroup); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteNodeGroupRequest request = new DeleteNodeGroupRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Zone, request.NodeGroup, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Zone, request.NodeGroup, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteNodesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteNodesNodeGroupRequest request = new DeleteNodesNodeGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - NodeGroupsDeleteNodesRequestResource = new NodeGroupsDeleteNodesRequest(), - Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteNodes(request, moq::It.IsAny())).Returns(expectedResponse); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.DeleteNodes(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteNodesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteNodesNodeGroupRequest request = new DeleteNodesNodeGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - NodeGroupsDeleteNodesRequestResource = new NodeGroupsDeleteNodesRequest(), - Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteNodesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteNodesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteNodesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteNodes() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteNodesNodeGroupRequest request = new DeleteNodesNodeGroupRequest - { - Zone = "zone255f4ea8", - NodeGroupsDeleteNodesRequestResource = new NodeGroupsDeleteNodesRequest(), - Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteNodes(request, moq::It.IsAny())).Returns(expectedResponse); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.DeleteNodes(request.Project, request.Zone, request.NodeGroup, request.NodeGroupsDeleteNodesRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteNodesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteNodesNodeGroupRequest request = new DeleteNodesNodeGroupRequest - { - Zone = "zone255f4ea8", - NodeGroupsDeleteNodesRequestResource = new NodeGroupsDeleteNodesRequest(), - Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteNodesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteNodesAsync(request.Project, request.Zone, request.NodeGroup, request.NodeGroupsDeleteNodesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteNodesAsync(request.Project, request.Zone, request.NodeGroup, request.NodeGroupsDeleteNodesRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetNodeGroupRequest request = new GetNodeGroupRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - }; - NodeGroup expectedResponse = new NodeGroup - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Size = -1218396681, - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - Status = NodeGroup.Types.Status.Ready, - MaintenanceWindow = new NodeGroupMaintenanceWindow(), - AutoscalingPolicy = new NodeGroupAutoscalingPolicy(), - Fingerprint = "fingerprint009e6052", - NodeTemplate = "node_template118e38ae", - LocationHint = "location_hint666f366c", - Description = "description2cf9da67", - SelfLink = "self_link7e87f12d", - MaintenancePolicy = NodeGroup.Types.MaintenancePolicy.Unspecified, - }; - mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - NodeGroup response = client.Get(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetNodeGroupRequest request = new GetNodeGroupRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - }; - NodeGroup expectedResponse = new NodeGroup - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Size = -1218396681, - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - Status = NodeGroup.Types.Status.Ready, - MaintenanceWindow = new NodeGroupMaintenanceWindow(), - AutoscalingPolicy = new NodeGroupAutoscalingPolicy(), - Fingerprint = "fingerprint009e6052", - NodeTemplate = "node_template118e38ae", - LocationHint = "location_hint666f366c", - Description = "description2cf9da67", - SelfLink = "self_link7e87f12d", - MaintenancePolicy = NodeGroup.Types.MaintenancePolicy.Unspecified, - }; - mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - NodeGroup responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - NodeGroup responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Get() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetNodeGroupRequest request = new GetNodeGroupRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - }; - NodeGroup expectedResponse = new NodeGroup - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Size = -1218396681, - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - Status = NodeGroup.Types.Status.Ready, - MaintenanceWindow = new NodeGroupMaintenanceWindow(), - AutoscalingPolicy = new NodeGroupAutoscalingPolicy(), - Fingerprint = "fingerprint009e6052", - NodeTemplate = "node_template118e38ae", - LocationHint = "location_hint666f366c", - Description = "description2cf9da67", - SelfLink = "self_link7e87f12d", - MaintenancePolicy = NodeGroup.Types.MaintenancePolicy.Unspecified, - }; - mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - NodeGroup response = client.Get(request.Project, request.Zone, request.NodeGroup); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetNodeGroupRequest request = new GetNodeGroupRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - }; - NodeGroup expectedResponse = new NodeGroup - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Size = -1218396681, - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - Status = NodeGroup.Types.Status.Ready, - MaintenanceWindow = new NodeGroupMaintenanceWindow(), - AutoscalingPolicy = new NodeGroupAutoscalingPolicy(), - Fingerprint = "fingerprint009e6052", - NodeTemplate = "node_template118e38ae", - LocationHint = "location_hint666f366c", - Description = "description2cf9da67", - SelfLink = "self_link7e87f12d", - MaintenancePolicy = NodeGroup.Types.MaintenancePolicy.Unspecified, - }; - mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - NodeGroup responseCallSettings = await client.GetAsync(request.Project, request.Zone, request.NodeGroup, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - NodeGroup responseCancellationToken = await client.GetAsync(request.Project, request.Zone, request.NodeGroup, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetIamPolicyRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetIamPolicyNodeGroupRequest request = new GetIamPolicyNodeGroupRequest - { - Zone = "zone255f4ea8", - Resource = "resource164eab96", - Project = "projectaa6ff846", - OptionsRequestedPolicyVersion = -1471234741, - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.GetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Policy response = client.GetIamPolicy(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetIamPolicyRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetIamPolicyNodeGroupRequest request = new GetIamPolicyNodeGroupRequest - { - Zone = "zone255f4ea8", - Resource = "resource164eab96", - Project = "projectaa6ff846", - OptionsRequestedPolicyVersion = -1471234741, - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.GetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Policy responseCallSettings = await client.GetIamPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Policy responseCancellationToken = await client.GetIamPolicyAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetIamPolicy() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetIamPolicyNodeGroupRequest request = new GetIamPolicyNodeGroupRequest - { - Zone = "zone255f4ea8", - Resource = "resource164eab96", - Project = "projectaa6ff846", - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.GetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Policy response = client.GetIamPolicy(request.Project, request.Zone, request.Resource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetIamPolicyAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetIamPolicyNodeGroupRequest request = new GetIamPolicyNodeGroupRequest - { - Zone = "zone255f4ea8", - Resource = "resource164eab96", - Project = "projectaa6ff846", - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.GetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Policy responseCallSettings = await client.GetIamPolicyAsync(request.Project, request.Zone, request.Resource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Policy responseCancellationToken = await client.GetIamPolicyAsync(request.Project, request.Zone, request.Resource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void InsertRequestObject() + public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertNodeGroupRequest request = new InsertNodeGroupRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetNodeGroupRequest request = new GetNodeGroupRequest { Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - InitialNodeCount = -1915714087, Project = "projectaa6ff846", - NodeGroupResource = new NodeGroup(), + NodeGroup = "node_groupa42a295a", }; - Operation expectedResponse = new Operation + NodeGroup expectedResponse = new NodeGroup { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", + Size = -1218396681, Zone = "zone255f4ea8", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Status = NodeGroup.Types.Status.Ready, + MaintenanceWindow = new NodeGroupMaintenanceWindow(), + AutoscalingPolicy = new NodeGroupAutoscalingPolicy(), + Fingerprint = "fingerprint009e6052", + NodeTemplate = "node_template118e38ae", + LocationHint = "location_hint666f366c", Description = "description2cf9da67", - InsertTime = "insert_time7467185a", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + MaintenancePolicy = NodeGroup.Types.MaintenancePolicy.Unspecified, }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); + NodeGroup response = client.Get(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() + public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertNodeGroupRequest request = new InsertNodeGroupRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetNodeGroupRequest request = new GetNodeGroupRequest { Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - InitialNodeCount = -1915714087, Project = "projectaa6ff846", - NodeGroupResource = new NodeGroup(), + NodeGroup = "node_groupa42a295a", }; - Operation expectedResponse = new Operation + NodeGroup expectedResponse = new NodeGroup { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", + Size = -1218396681, Zone = "zone255f4ea8", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Status = NodeGroup.Types.Status.Ready, + MaintenanceWindow = new NodeGroupMaintenanceWindow(), + AutoscalingPolicy = new NodeGroupAutoscalingPolicy(), + Fingerprint = "fingerprint009e6052", + NodeTemplate = "node_template118e38ae", + LocationHint = "location_hint666f366c", Description = "description2cf9da67", - InsertTime = "insert_time7467185a", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + MaintenancePolicy = NodeGroup.Types.MaintenancePolicy.Unspecified, }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + NodeGroup responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); + NodeGroup responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void Insert() + public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertNodeGroupRequest request = new InsertNodeGroupRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetNodeGroupRequest request = new GetNodeGroupRequest { Zone = "zone255f4ea8", - InitialNodeCount = -1915714087, Project = "projectaa6ff846", - NodeGroupResource = new NodeGroup(), + NodeGroup = "node_groupa42a295a", }; - Operation expectedResponse = new Operation + NodeGroup expectedResponse = new NodeGroup { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", + Size = -1218396681, Zone = "zone255f4ea8", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Status = NodeGroup.Types.Status.Ready, + MaintenanceWindow = new NodeGroupMaintenanceWindow(), + AutoscalingPolicy = new NodeGroupAutoscalingPolicy(), + Fingerprint = "fingerprint009e6052", + NodeTemplate = "node_template118e38ae", + LocationHint = "location_hint666f366c", Description = "description2cf9da67", - InsertTime = "insert_time7467185a", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + MaintenancePolicy = NodeGroup.Types.MaintenancePolicy.Unspecified, }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Zone, request.InitialNodeCount, request.NodeGroupResource); + NodeGroup response = client.Get(request.Project, request.Zone, request.NodeGroup); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task InsertAsync() + public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertNodeGroupRequest request = new InsertNodeGroupRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetNodeGroupRequest request = new GetNodeGroupRequest { Zone = "zone255f4ea8", - InitialNodeCount = -1915714087, Project = "projectaa6ff846", - NodeGroupResource = new NodeGroup(), + NodeGroup = "node_groupa42a295a", }; - Operation expectedResponse = new Operation + NodeGroup expectedResponse = new NodeGroup { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", + Size = -1218396681, Zone = "zone255f4ea8", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Status = NodeGroup.Types.Status.Ready, + MaintenanceWindow = new NodeGroupMaintenanceWindow(), + AutoscalingPolicy = new NodeGroupAutoscalingPolicy(), + Fingerprint = "fingerprint009e6052", + NodeTemplate = "node_template118e38ae", + LocationHint = "location_hint666f366c", Description = "description2cf9da67", - InsertTime = "insert_time7467185a", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + MaintenancePolicy = NodeGroup.Types.MaintenancePolicy.Unspecified, }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Zone, request.InitialNodeCount, request.NodeGroupResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + NodeGroup responseCallSettings = await client.GetAsync(request.Project, request.Zone, request.NodeGroup, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Zone, request.InitialNodeCount, request.NodeGroupResource, st::CancellationToken.None); + NodeGroup responseCancellationToken = await client.GetAsync(request.Project, request.Zone, request.NodeGroup, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void PatchRequestObject() + public void GetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchNodeGroupRequest request = new PatchNodeGroupRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetIamPolicyNodeGroupRequest request = new GetIamPolicyNodeGroupRequest { Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", + Resource = "resource164eab96", Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - NodeGroupResource = new NodeGroup(), + OptionsRequestedPolicyVersion = -1471234741, }; - Operation expectedResponse = new Operation + Policy expectedResponse = new Policy { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); + Policy response = client.GetIamPolicy(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() + public async stt::Task GetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchNodeGroupRequest request = new PatchNodeGroupRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetIamPolicyNodeGroupRequest request = new GetIamPolicyNodeGroupRequest { Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", + Resource = "resource164eab96", Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - NodeGroupResource = new NodeGroup(), + OptionsRequestedPolicyVersion = -1471234741, }; - Operation expectedResponse = new Operation + Policy expectedResponse = new Policy { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Policy responseCallSettings = await client.GetIamPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); + Policy responseCancellationToken = await client.GetIamPolicyAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void Patch() + public void GetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchNodeGroupRequest request = new PatchNodeGroupRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetIamPolicyNodeGroupRequest request = new GetIamPolicyNodeGroupRequest { Zone = "zone255f4ea8", + Resource = "resource164eab96", Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - NodeGroupResource = new NodeGroup(), }; - Operation expectedResponse = new Operation + Policy expectedResponse = new Policy { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.Zone, request.NodeGroup, request.NodeGroupResource); + Policy response = client.GetIamPolicy(request.Project, request.Zone, request.Resource); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task PatchAsync() + public async stt::Task GetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchNodeGroupRequest request = new PatchNodeGroupRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); + GetIamPolicyNodeGroupRequest request = new GetIamPolicyNodeGroupRequest { Zone = "zone255f4ea8", + Resource = "resource164eab96", Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - NodeGroupResource = new NodeGroup(), }; - Operation expectedResponse = new Operation + Policy expectedResponse = new Policy { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.Zone, request.NodeGroup, request.NodeGroupResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Policy responseCallSettings = await client.GetIamPolicyAsync(request.Project, request.Zone, request.Resource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.Zone, request.NodeGroup, request.NodeGroupResource, st::CancellationToken.None); + Policy responseCancellationToken = await client.GetIamPolicyAsync(request.Project, request.Zone, request.Resource, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } @@ -1210,6 +293,7 @@ public void Patch() public void SetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); SetIamPolicyNodeGroupRequest request = new SetIamPolicyNodeGroupRequest { Zone = "zone255f4ea8", @@ -1237,6 +321,7 @@ public void SetIamPolicyRequestObject() public async stt::Task SetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); SetIamPolicyNodeGroupRequest request = new SetIamPolicyNodeGroupRequest { Zone = "zone255f4ea8", @@ -1266,6 +351,7 @@ public void SetIamPolicyRequestObject() public void SetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); SetIamPolicyNodeGroupRequest request = new SetIamPolicyNodeGroupRequest { Zone = "zone255f4ea8", @@ -1293,6 +379,7 @@ public void SetIamPolicy() public async stt::Task SetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); SetIamPolicyNodeGroupRequest request = new SetIamPolicyNodeGroupRequest { Zone = "zone255f4ea8", @@ -1318,196 +405,11 @@ public void SetIamPolicy() mockGrpcClient.VerifyAll(); } - [xunit::FactAttribute] - public void SetNodeTemplateRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetNodeTemplateNodeGroupRequest request = new SetNodeTemplateNodeGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - NodeGroupsSetNodeTemplateRequestResource = new NodeGroupsSetNodeTemplateRequest(), - Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetNodeTemplate(request, moq::It.IsAny())).Returns(expectedResponse); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetNodeTemplate(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetNodeTemplateRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetNodeTemplateNodeGroupRequest request = new SetNodeTemplateNodeGroupRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - NodeGroupsSetNodeTemplateRequestResource = new NodeGroupsSetNodeTemplateRequest(), - Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetNodeTemplateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetNodeTemplateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetNodeTemplateAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetNodeTemplate() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetNodeTemplateNodeGroupRequest request = new SetNodeTemplateNodeGroupRequest - { - Zone = "zone255f4ea8", - NodeGroupsSetNodeTemplateRequestResource = new NodeGroupsSetNodeTemplateRequest(), - Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetNodeTemplate(request, moq::It.IsAny())).Returns(expectedResponse); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetNodeTemplate(request.Project, request.Zone, request.NodeGroup, request.NodeGroupsSetNodeTemplateRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetNodeTemplateAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetNodeTemplateNodeGroupRequest request = new SetNodeTemplateNodeGroupRequest - { - Zone = "zone255f4ea8", - NodeGroupsSetNodeTemplateRequestResource = new NodeGroupsSetNodeTemplateRequest(), - Project = "projectaa6ff846", - NodeGroup = "node_groupa42a295a", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetNodeTemplateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NodeGroupsClient client = new NodeGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetNodeTemplateAsync(request.Project, request.Zone, request.NodeGroup, request.NodeGroupsSetNodeTemplateRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetNodeTemplateAsync(request.Project, request.Zone, request.NodeGroup, request.NodeGroupsSetNodeTemplateRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void TestIamPermissionsRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); TestIamPermissionsNodeGroupRequest request = new TestIamPermissionsNodeGroupRequest { Zone = "zone255f4ea8", @@ -1533,6 +435,7 @@ public void TestIamPermissionsRequestObject() public async stt::Task TestIamPermissionsRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); TestIamPermissionsNodeGroupRequest request = new TestIamPermissionsNodeGroupRequest { Zone = "zone255f4ea8", @@ -1560,6 +463,7 @@ public void TestIamPermissionsRequestObject() public void TestIamPermissions() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); TestIamPermissionsNodeGroupRequest request = new TestIamPermissionsNodeGroupRequest { Zone = "zone255f4ea8", @@ -1585,6 +489,7 @@ public void TestIamPermissions() public async stt::Task TestIamPermissionsAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); TestIamPermissionsNodeGroupRequest request = new TestIamPermissionsNodeGroupRequest { Zone = "zone255f4ea8", diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/NodeTemplatesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/NodeTemplatesClientTest.g.cs index 0141c46b0980..b19cb7bb8b84 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/NodeTemplatesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/NodeTemplatesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedNodeTemplatesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteNodeTemplateRequest request = new DeleteNodeTemplateRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - NodeTemplate = "node_template118e38ae", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - NodeTemplatesClient client = new NodeTemplatesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteNodeTemplateRequest request = new DeleteNodeTemplateRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - NodeTemplate = "node_template118e38ae", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NodeTemplatesClient client = new NodeTemplatesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteNodeTemplateRequest request = new DeleteNodeTemplateRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - NodeTemplate = "node_template118e38ae", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - NodeTemplatesClient client = new NodeTemplatesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.NodeTemplate); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteNodeTemplateRequest request = new DeleteNodeTemplateRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - NodeTemplate = "node_template118e38ae", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NodeTemplatesClient client = new NodeTemplatesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.NodeTemplate, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.NodeTemplate, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetNodeTemplateRequest request = new GetNodeTemplateRequest { Region = "regionedb20d96", @@ -257,6 +77,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetNodeTemplateRequest request = new GetNodeTemplateRequest { Region = "regionedb20d96", @@ -304,6 +125,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetNodeTemplateRequest request = new GetNodeTemplateRequest { Region = "regionedb20d96", @@ -349,6 +171,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetNodeTemplateRequest request = new GetNodeTemplateRequest { Region = "regionedb20d96", @@ -396,6 +219,7 @@ public void Get() public void GetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetIamPolicyNodeTemplateRequest request = new GetIamPolicyNodeTemplateRequest { Region = "regionedb20d96", @@ -423,6 +247,7 @@ public void GetIamPolicyRequestObject() public async stt::Task GetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetIamPolicyNodeTemplateRequest request = new GetIamPolicyNodeTemplateRequest { Region = "regionedb20d96", @@ -452,6 +277,7 @@ public void GetIamPolicyRequestObject() public void GetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetIamPolicyNodeTemplateRequest request = new GetIamPolicyNodeTemplateRequest { Region = "regionedb20d96", @@ -478,6 +304,7 @@ public void GetIamPolicy() public async stt::Task GetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetIamPolicyNodeTemplateRequest request = new GetIamPolicyNodeTemplateRequest { Region = "regionedb20d96", @@ -502,192 +329,11 @@ public void GetIamPolicy() mockGrpcClient.VerifyAll(); } - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertNodeTemplateRequest request = new InsertNodeTemplateRequest - { - RequestId = "request_id362c8df6", - NodeTemplateResource = new NodeTemplate(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - NodeTemplatesClient client = new NodeTemplatesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertNodeTemplateRequest request = new InsertNodeTemplateRequest - { - RequestId = "request_id362c8df6", - NodeTemplateResource = new NodeTemplate(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NodeTemplatesClient client = new NodeTemplatesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertNodeTemplateRequest request = new InsertNodeTemplateRequest - { - NodeTemplateResource = new NodeTemplate(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - NodeTemplatesClient client = new NodeTemplatesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.NodeTemplateResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertNodeTemplateRequest request = new InsertNodeTemplateRequest - { - NodeTemplateResource = new NodeTemplate(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - NodeTemplatesClient client = new NodeTemplatesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.NodeTemplateResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.NodeTemplateResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void SetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); SetIamPolicyNodeTemplateRequest request = new SetIamPolicyNodeTemplateRequest { Region = "regionedb20d96", @@ -715,6 +361,7 @@ public void SetIamPolicyRequestObject() public async stt::Task SetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); SetIamPolicyNodeTemplateRequest request = new SetIamPolicyNodeTemplateRequest { Region = "regionedb20d96", @@ -744,6 +391,7 @@ public void SetIamPolicyRequestObject() public void SetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); SetIamPolicyNodeTemplateRequest request = new SetIamPolicyNodeTemplateRequest { Region = "regionedb20d96", @@ -771,6 +419,7 @@ public void SetIamPolicy() public async stt::Task SetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); SetIamPolicyNodeTemplateRequest request = new SetIamPolicyNodeTemplateRequest { Region = "regionedb20d96", @@ -800,6 +449,7 @@ public void SetIamPolicy() public void TestIamPermissionsRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsNodeTemplateRequest request = new TestIamPermissionsNodeTemplateRequest { Region = "regionedb20d96", @@ -825,6 +475,7 @@ public void TestIamPermissionsRequestObject() public async stt::Task TestIamPermissionsRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsNodeTemplateRequest request = new TestIamPermissionsNodeTemplateRequest { Region = "regionedb20d96", @@ -852,6 +503,7 @@ public void TestIamPermissionsRequestObject() public void TestIamPermissions() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsNodeTemplateRequest request = new TestIamPermissionsNodeTemplateRequest { Region = "regionedb20d96", @@ -877,6 +529,7 @@ public void TestIamPermissions() public async stt::Task TestIamPermissionsAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsNodeTemplateRequest request = new TestIamPermissionsNodeTemplateRequest { Region = "regionedb20d96", diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/PacketMirroringsClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/PacketMirroringsClientTest.g.cs index 478a14f9f8ee..ea023d255f9d 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/PacketMirroringsClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/PacketMirroringsClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedPacketMirroringsClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeletePacketMirroringRequest request = new DeletePacketMirroringRequest - { - PacketMirroring = "packet_mirroringf2de2a5f", - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - PacketMirroringsClient client = new PacketMirroringsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeletePacketMirroringRequest request = new DeletePacketMirroringRequest - { - PacketMirroring = "packet_mirroringf2de2a5f", - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - PacketMirroringsClient client = new PacketMirroringsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeletePacketMirroringRequest request = new DeletePacketMirroringRequest - { - PacketMirroring = "packet_mirroringf2de2a5f", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - PacketMirroringsClient client = new PacketMirroringsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.PacketMirroring); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeletePacketMirroringRequest request = new DeletePacketMirroringRequest - { - PacketMirroring = "packet_mirroringf2de2a5f", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - PacketMirroringsClient client = new PacketMirroringsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.PacketMirroring, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.PacketMirroring, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetPacketMirroringRequest request = new GetPacketMirroringRequest { PacketMirroring = "packet_mirroringf2de2a5f", @@ -245,6 +65,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetPacketMirroringRequest request = new GetPacketMirroringRequest { PacketMirroring = "packet_mirroringf2de2a5f", @@ -280,6 +101,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetPacketMirroringRequest request = new GetPacketMirroringRequest { PacketMirroring = "packet_mirroringf2de2a5f", @@ -313,6 +135,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetPacketMirroringRequest request = new GetPacketMirroringRequest { PacketMirroring = "packet_mirroringf2de2a5f", @@ -344,378 +167,11 @@ public void Get() mockGrpcClient.VerifyAll(); } - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertPacketMirroringRequest request = new InsertPacketMirroringRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - PacketMirroringResource = new PacketMirroring(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - PacketMirroringsClient client = new PacketMirroringsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertPacketMirroringRequest request = new InsertPacketMirroringRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - PacketMirroringResource = new PacketMirroring(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - PacketMirroringsClient client = new PacketMirroringsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertPacketMirroringRequest request = new InsertPacketMirroringRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - PacketMirroringResource = new PacketMirroring(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - PacketMirroringsClient client = new PacketMirroringsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.PacketMirroringResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertPacketMirroringRequest request = new InsertPacketMirroringRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - PacketMirroringResource = new PacketMirroring(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - PacketMirroringsClient client = new PacketMirroringsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.PacketMirroringResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.PacketMirroringResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchPacketMirroringRequest request = new PatchPacketMirroringRequest - { - PacketMirroring = "packet_mirroringf2de2a5f", - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - PacketMirroringResource = new PacketMirroring(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - PacketMirroringsClient client = new PacketMirroringsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchPacketMirroringRequest request = new PatchPacketMirroringRequest - { - PacketMirroring = "packet_mirroringf2de2a5f", - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - PacketMirroringResource = new PacketMirroring(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - PacketMirroringsClient client = new PacketMirroringsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchPacketMirroringRequest request = new PatchPacketMirroringRequest - { - PacketMirroring = "packet_mirroringf2de2a5f", - Region = "regionedb20d96", - Project = "projectaa6ff846", - PacketMirroringResource = new PacketMirroring(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - PacketMirroringsClient client = new PacketMirroringsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.Region, request.PacketMirroring, request.PacketMirroringResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchPacketMirroringRequest request = new PatchPacketMirroringRequest - { - PacketMirroring = "packet_mirroringf2de2a5f", - Region = "regionedb20d96", - Project = "projectaa6ff846", - PacketMirroringResource = new PacketMirroring(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - PacketMirroringsClient client = new PacketMirroringsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.Region, request.PacketMirroring, request.PacketMirroringResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.Region, request.PacketMirroring, request.PacketMirroringResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void TestIamPermissionsRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsPacketMirroringRequest request = new TestIamPermissionsPacketMirroringRequest { Region = "regionedb20d96", @@ -741,6 +197,7 @@ public void TestIamPermissionsRequestObject() public async stt::Task TestIamPermissionsRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsPacketMirroringRequest request = new TestIamPermissionsPacketMirroringRequest { Region = "regionedb20d96", @@ -768,6 +225,7 @@ public void TestIamPermissionsRequestObject() public void TestIamPermissions() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsPacketMirroringRequest request = new TestIamPermissionsPacketMirroringRequest { Region = "regionedb20d96", @@ -793,6 +251,7 @@ public void TestIamPermissions() public async stt::Task TestIamPermissionsAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsPacketMirroringRequest request = new TestIamPermissionsPacketMirroringRequest { Region = "regionedb20d96", diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ProjectsClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ProjectsClientTest.g.cs index ab244f50d01d..a3e8792df191 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ProjectsClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ProjectsClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -27,1875 +28,289 @@ namespace Google.Cloud.Compute.V1.Tests public sealed class GeneratedProjectsClientTest { [xunit::FactAttribute] - public void DisableXpnHostRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DisableXpnHostProjectRequest request = new DisableXpnHostProjectRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DisableXpnHost(request, moq::It.IsAny())).Returns(expectedResponse); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.DisableXpnHost(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DisableXpnHostRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DisableXpnHostProjectRequest request = new DisableXpnHostProjectRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DisableXpnHostAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DisableXpnHostAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DisableXpnHostAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DisableXpnHost() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DisableXpnHostProjectRequest request = new DisableXpnHostProjectRequest - { - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DisableXpnHost(request, moq::It.IsAny())).Returns(expectedResponse); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.DisableXpnHost(request.Project); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DisableXpnHostAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DisableXpnHostProjectRequest request = new DisableXpnHostProjectRequest - { - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DisableXpnHostAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DisableXpnHostAsync(request.Project, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DisableXpnHostAsync(request.Project, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DisableXpnResourceRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DisableXpnResourceProjectRequest request = new DisableXpnResourceProjectRequest - { - RequestId = "request_id362c8df6", - ProjectsDisableXpnResourceRequestResource = new ProjectsDisableXpnResourceRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DisableXpnResource(request, moq::It.IsAny())).Returns(expectedResponse); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.DisableXpnResource(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DisableXpnResourceRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DisableXpnResourceProjectRequest request = new DisableXpnResourceProjectRequest - { - RequestId = "request_id362c8df6", - ProjectsDisableXpnResourceRequestResource = new ProjectsDisableXpnResourceRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DisableXpnResourceAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DisableXpnResourceAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DisableXpnResourceAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DisableXpnResource() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DisableXpnResourceProjectRequest request = new DisableXpnResourceProjectRequest - { - ProjectsDisableXpnResourceRequestResource = new ProjectsDisableXpnResourceRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DisableXpnResource(request, moq::It.IsAny())).Returns(expectedResponse); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.DisableXpnResource(request.Project, request.ProjectsDisableXpnResourceRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DisableXpnResourceAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DisableXpnResourceProjectRequest request = new DisableXpnResourceProjectRequest - { - ProjectsDisableXpnResourceRequestResource = new ProjectsDisableXpnResourceRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DisableXpnResourceAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DisableXpnResourceAsync(request.Project, request.ProjectsDisableXpnResourceRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DisableXpnResourceAsync(request.Project, request.ProjectsDisableXpnResourceRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void EnableXpnHostRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - EnableXpnHostProjectRequest request = new EnableXpnHostProjectRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.EnableXpnHost(request, moq::It.IsAny())).Returns(expectedResponse); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.EnableXpnHost(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task EnableXpnHostRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - EnableXpnHostProjectRequest request = new EnableXpnHostProjectRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.EnableXpnHostAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.EnableXpnHostAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.EnableXpnHostAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void EnableXpnHost() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - EnableXpnHostProjectRequest request = new EnableXpnHostProjectRequest - { - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.EnableXpnHost(request, moq::It.IsAny())).Returns(expectedResponse); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.EnableXpnHost(request.Project); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task EnableXpnHostAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - EnableXpnHostProjectRequest request = new EnableXpnHostProjectRequest - { - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.EnableXpnHostAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.EnableXpnHostAsync(request.Project, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.EnableXpnHostAsync(request.Project, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void EnableXpnResourceRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - EnableXpnResourceProjectRequest request = new EnableXpnResourceProjectRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - ProjectsEnableXpnResourceRequestResource = new ProjectsEnableXpnResourceRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.EnableXpnResource(request, moq::It.IsAny())).Returns(expectedResponse); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.EnableXpnResource(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task EnableXpnResourceRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - EnableXpnResourceProjectRequest request = new EnableXpnResourceProjectRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - ProjectsEnableXpnResourceRequestResource = new ProjectsEnableXpnResourceRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.EnableXpnResourceAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.EnableXpnResourceAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.EnableXpnResourceAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void EnableXpnResource() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - EnableXpnResourceProjectRequest request = new EnableXpnResourceProjectRequest - { - Project = "projectaa6ff846", - ProjectsEnableXpnResourceRequestResource = new ProjectsEnableXpnResourceRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.EnableXpnResource(request, moq::It.IsAny())).Returns(expectedResponse); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.EnableXpnResource(request.Project, request.ProjectsEnableXpnResourceRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task EnableXpnResourceAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - EnableXpnResourceProjectRequest request = new EnableXpnResourceProjectRequest - { - Project = "projectaa6ff846", - ProjectsEnableXpnResourceRequestResource = new ProjectsEnableXpnResourceRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.EnableXpnResourceAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.EnableXpnResourceAsync(request.Project, request.ProjectsEnableXpnResourceRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.EnableXpnResourceAsync(request.Project, request.ProjectsEnableXpnResourceRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetProjectRequest request = new GetProjectRequest - { - Project = "projectaa6ff846", - }; - Project expectedResponse = new Project - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - CreationTimestamp = "creation_timestamp235e59a1", - Quotas = { new Quota(), }, - CommonInstanceMetadata = new Metadata(), - XpnProjectStatus = Project.Types.XpnProjectStatus.Host, - DefaultServiceAccount = "default_service_accountdf12b0f2", - UsageExportLocation = new UsageExportLocation(), - Description = "description2cf9da67", - SelfLink = "self_link7e87f12d", - EnabledFeatures = - { - "enabled_featuresf1f398e0", - }, - DefaultNetworkTier = Project.Types.DefaultNetworkTier.Premium, - }; - mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Project response = client.Get(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetProjectRequest request = new GetProjectRequest - { - Project = "projectaa6ff846", - }; - Project expectedResponse = new Project - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - CreationTimestamp = "creation_timestamp235e59a1", - Quotas = { new Quota(), }, - CommonInstanceMetadata = new Metadata(), - XpnProjectStatus = Project.Types.XpnProjectStatus.Host, - DefaultServiceAccount = "default_service_accountdf12b0f2", - UsageExportLocation = new UsageExportLocation(), - Description = "description2cf9da67", - SelfLink = "self_link7e87f12d", - EnabledFeatures = - { - "enabled_featuresf1f398e0", - }, - DefaultNetworkTier = Project.Types.DefaultNetworkTier.Premium, - }; - mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Project responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Project responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Get() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetProjectRequest request = new GetProjectRequest - { - Project = "projectaa6ff846", - }; - Project expectedResponse = new Project - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - CreationTimestamp = "creation_timestamp235e59a1", - Quotas = { new Quota(), }, - CommonInstanceMetadata = new Metadata(), - XpnProjectStatus = Project.Types.XpnProjectStatus.Host, - DefaultServiceAccount = "default_service_accountdf12b0f2", - UsageExportLocation = new UsageExportLocation(), - Description = "description2cf9da67", - SelfLink = "self_link7e87f12d", - EnabledFeatures = - { - "enabled_featuresf1f398e0", - }, - DefaultNetworkTier = Project.Types.DefaultNetworkTier.Premium, - }; - mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Project response = client.Get(request.Project); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetProjectRequest request = new GetProjectRequest - { - Project = "projectaa6ff846", - }; - Project expectedResponse = new Project - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - CreationTimestamp = "creation_timestamp235e59a1", - Quotas = { new Quota(), }, - CommonInstanceMetadata = new Metadata(), - XpnProjectStatus = Project.Types.XpnProjectStatus.Host, - DefaultServiceAccount = "default_service_accountdf12b0f2", - UsageExportLocation = new UsageExportLocation(), - Description = "description2cf9da67", - SelfLink = "self_link7e87f12d", - EnabledFeatures = - { - "enabled_featuresf1f398e0", - }, - DefaultNetworkTier = Project.Types.DefaultNetworkTier.Premium, - }; - mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Project responseCallSettings = await client.GetAsync(request.Project, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Project responseCancellationToken = await client.GetAsync(request.Project, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetXpnHostRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetXpnHostProjectRequest request = new GetXpnHostProjectRequest - { - Project = "projectaa6ff846", - }; - Project expectedResponse = new Project - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - CreationTimestamp = "creation_timestamp235e59a1", - Quotas = { new Quota(), }, - CommonInstanceMetadata = new Metadata(), - XpnProjectStatus = Project.Types.XpnProjectStatus.Host, - DefaultServiceAccount = "default_service_accountdf12b0f2", - UsageExportLocation = new UsageExportLocation(), - Description = "description2cf9da67", - SelfLink = "self_link7e87f12d", - EnabledFeatures = - { - "enabled_featuresf1f398e0", - }, - DefaultNetworkTier = Project.Types.DefaultNetworkTier.Premium, - }; - mockGrpcClient.Setup(x => x.GetXpnHost(request, moq::It.IsAny())).Returns(expectedResponse); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Project response = client.GetXpnHost(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetXpnHostRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetXpnHostProjectRequest request = new GetXpnHostProjectRequest - { - Project = "projectaa6ff846", - }; - Project expectedResponse = new Project - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - CreationTimestamp = "creation_timestamp235e59a1", - Quotas = { new Quota(), }, - CommonInstanceMetadata = new Metadata(), - XpnProjectStatus = Project.Types.XpnProjectStatus.Host, - DefaultServiceAccount = "default_service_accountdf12b0f2", - UsageExportLocation = new UsageExportLocation(), - Description = "description2cf9da67", - SelfLink = "self_link7e87f12d", - EnabledFeatures = - { - "enabled_featuresf1f398e0", - }, - DefaultNetworkTier = Project.Types.DefaultNetworkTier.Premium, - }; - mockGrpcClient.Setup(x => x.GetXpnHostAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Project responseCallSettings = await client.GetXpnHostAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Project responseCancellationToken = await client.GetXpnHostAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetXpnHost() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetXpnHostProjectRequest request = new GetXpnHostProjectRequest - { - Project = "projectaa6ff846", - }; - Project expectedResponse = new Project - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - CreationTimestamp = "creation_timestamp235e59a1", - Quotas = { new Quota(), }, - CommonInstanceMetadata = new Metadata(), - XpnProjectStatus = Project.Types.XpnProjectStatus.Host, - DefaultServiceAccount = "default_service_accountdf12b0f2", - UsageExportLocation = new UsageExportLocation(), - Description = "description2cf9da67", - SelfLink = "self_link7e87f12d", - EnabledFeatures = - { - "enabled_featuresf1f398e0", - }, - DefaultNetworkTier = Project.Types.DefaultNetworkTier.Premium, - }; - mockGrpcClient.Setup(x => x.GetXpnHost(request, moq::It.IsAny())).Returns(expectedResponse); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Project response = client.GetXpnHost(request.Project); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetXpnHostAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetXpnHostProjectRequest request = new GetXpnHostProjectRequest - { - Project = "projectaa6ff846", - }; - Project expectedResponse = new Project - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - CreationTimestamp = "creation_timestamp235e59a1", - Quotas = { new Quota(), }, - CommonInstanceMetadata = new Metadata(), - XpnProjectStatus = Project.Types.XpnProjectStatus.Host, - DefaultServiceAccount = "default_service_accountdf12b0f2", - UsageExportLocation = new UsageExportLocation(), - Description = "description2cf9da67", - SelfLink = "self_link7e87f12d", - EnabledFeatures = - { - "enabled_featuresf1f398e0", - }, - DefaultNetworkTier = Project.Types.DefaultNetworkTier.Premium, - }; - mockGrpcClient.Setup(x => x.GetXpnHostAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Project responseCallSettings = await client.GetXpnHostAsync(request.Project, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Project responseCancellationToken = await client.GetXpnHostAsync(request.Project, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void MoveDiskRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - MoveDiskProjectRequest request = new MoveDiskProjectRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - DiskMoveRequestResource = new DiskMoveRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.MoveDisk(request, moq::It.IsAny())).Returns(expectedResponse); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.MoveDisk(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task MoveDiskRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - MoveDiskProjectRequest request = new MoveDiskProjectRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - DiskMoveRequestResource = new DiskMoveRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.MoveDiskAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.MoveDiskAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.MoveDiskAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void MoveDisk() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - MoveDiskProjectRequest request = new MoveDiskProjectRequest - { - Project = "projectaa6ff846", - DiskMoveRequestResource = new DiskMoveRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.MoveDisk(request, moq::It.IsAny())).Returns(expectedResponse); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.MoveDisk(request.Project, request.DiskMoveRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task MoveDiskAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - MoveDiskProjectRequest request = new MoveDiskProjectRequest - { - Project = "projectaa6ff846", - DiskMoveRequestResource = new DiskMoveRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.MoveDiskAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.MoveDiskAsync(request.Project, request.DiskMoveRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.MoveDiskAsync(request.Project, request.DiskMoveRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void MoveInstanceRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - MoveInstanceProjectRequest request = new MoveInstanceProjectRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceMoveRequestResource = new InstanceMoveRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.MoveInstance(request, moq::It.IsAny())).Returns(expectedResponse); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.MoveInstance(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task MoveInstanceRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - MoveInstanceProjectRequest request = new MoveInstanceProjectRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - InstanceMoveRequestResource = new InstanceMoveRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.MoveInstanceAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.MoveInstanceAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.MoveInstanceAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void MoveInstance() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - MoveInstanceProjectRequest request = new MoveInstanceProjectRequest - { - Project = "projectaa6ff846", - InstanceMoveRequestResource = new InstanceMoveRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.MoveInstance(request, moq::It.IsAny())).Returns(expectedResponse); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.MoveInstance(request.Project, request.InstanceMoveRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task MoveInstanceAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - MoveInstanceProjectRequest request = new MoveInstanceProjectRequest - { - Project = "projectaa6ff846", - InstanceMoveRequestResource = new InstanceMoveRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.MoveInstanceAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.MoveInstanceAsync(request.Project, request.InstanceMoveRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.MoveInstanceAsync(request.Project, request.InstanceMoveRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetCommonInstanceMetadataRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetCommonInstanceMetadataProjectRequest request = new SetCommonInstanceMetadataProjectRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - MetadataResource = new Metadata(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetCommonInstanceMetadata(request, moq::It.IsAny())).Returns(expectedResponse); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetCommonInstanceMetadata(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetCommonInstanceMetadataRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetCommonInstanceMetadataProjectRequest request = new SetCommonInstanceMetadataProjectRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - MetadataResource = new Metadata(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetCommonInstanceMetadataAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetCommonInstanceMetadataAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetCommonInstanceMetadataAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetCommonInstanceMetadata() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetCommonInstanceMetadataProjectRequest request = new SetCommonInstanceMetadataProjectRequest - { - Project = "projectaa6ff846", - MetadataResource = new Metadata(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetCommonInstanceMetadata(request, moq::It.IsAny())).Returns(expectedResponse); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetCommonInstanceMetadata(request.Project, request.MetadataResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetCommonInstanceMetadataAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetCommonInstanceMetadataProjectRequest request = new SetCommonInstanceMetadataProjectRequest - { - Project = "projectaa6ff846", - MetadataResource = new Metadata(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetCommonInstanceMetadataAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetCommonInstanceMetadataAsync(request.Project, request.MetadataResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetCommonInstanceMetadataAsync(request.Project, request.MetadataResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetDefaultNetworkTierRequestObject() + public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetDefaultNetworkTierProjectRequest request = new SetDefaultNetworkTierProjectRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); + GetProjectRequest request = new GetProjectRequest { - RequestId = "request_id362c8df6", - ProjectsSetDefaultNetworkTierRequestResource = new ProjectsSetDefaultNetworkTierRequest(), Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + Project expectedResponse = new Project { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Quotas = { new Quota(), }, + CommonInstanceMetadata = new Metadata(), + XpnProjectStatus = Project.Types.XpnProjectStatus.Host, + DefaultServiceAccount = "default_service_accountdf12b0f2", + UsageExportLocation = new UsageExportLocation(), Description = "description2cf9da67", - InsertTime = "insert_time7467185a", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + EnabledFeatures = + { + "enabled_featuresf1f398e0", + }, + DefaultNetworkTier = Project.Types.DefaultNetworkTier.Premium, }; - mockGrpcClient.Setup(x => x.SetDefaultNetworkTier(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetDefaultNetworkTier(request); + Project response = client.Get(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task SetDefaultNetworkTierRequestObjectAsync() + public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetDefaultNetworkTierProjectRequest request = new SetDefaultNetworkTierProjectRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); + GetProjectRequest request = new GetProjectRequest { - RequestId = "request_id362c8df6", - ProjectsSetDefaultNetworkTierRequestResource = new ProjectsSetDefaultNetworkTierRequest(), Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + Project expectedResponse = new Project { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Quotas = { new Quota(), }, + CommonInstanceMetadata = new Metadata(), + XpnProjectStatus = Project.Types.XpnProjectStatus.Host, + DefaultServiceAccount = "default_service_accountdf12b0f2", + UsageExportLocation = new UsageExportLocation(), Description = "description2cf9da67", - InsertTime = "insert_time7467185a", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + EnabledFeatures = + { + "enabled_featuresf1f398e0", + }, + DefaultNetworkTier = Project.Types.DefaultNetworkTier.Premium, }; - mockGrpcClient.Setup(x => x.SetDefaultNetworkTierAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetDefaultNetworkTierAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Project responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetDefaultNetworkTierAsync(request, st::CancellationToken.None); + Project responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void SetDefaultNetworkTier() + public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetDefaultNetworkTierProjectRequest request = new SetDefaultNetworkTierProjectRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); + GetProjectRequest request = new GetProjectRequest { - ProjectsSetDefaultNetworkTierRequestResource = new ProjectsSetDefaultNetworkTierRequest(), Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + Project expectedResponse = new Project { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Quotas = { new Quota(), }, + CommonInstanceMetadata = new Metadata(), + XpnProjectStatus = Project.Types.XpnProjectStatus.Host, + DefaultServiceAccount = "default_service_accountdf12b0f2", + UsageExportLocation = new UsageExportLocation(), Description = "description2cf9da67", - InsertTime = "insert_time7467185a", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + EnabledFeatures = + { + "enabled_featuresf1f398e0", + }, + DefaultNetworkTier = Project.Types.DefaultNetworkTier.Premium, }; - mockGrpcClient.Setup(x => x.SetDefaultNetworkTier(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetDefaultNetworkTier(request.Project, request.ProjectsSetDefaultNetworkTierRequestResource); + Project response = client.Get(request.Project); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task SetDefaultNetworkTierAsync() + public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetDefaultNetworkTierProjectRequest request = new SetDefaultNetworkTierProjectRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); + GetProjectRequest request = new GetProjectRequest { - ProjectsSetDefaultNetworkTierRequestResource = new ProjectsSetDefaultNetworkTierRequest(), Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + Project expectedResponse = new Project { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Quotas = { new Quota(), }, + CommonInstanceMetadata = new Metadata(), + XpnProjectStatus = Project.Types.XpnProjectStatus.Host, + DefaultServiceAccount = "default_service_accountdf12b0f2", + UsageExportLocation = new UsageExportLocation(), Description = "description2cf9da67", - InsertTime = "insert_time7467185a", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + EnabledFeatures = + { + "enabled_featuresf1f398e0", + }, + DefaultNetworkTier = Project.Types.DefaultNetworkTier.Premium, }; - mockGrpcClient.Setup(x => x.SetDefaultNetworkTierAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetDefaultNetworkTierAsync(request.Project, request.ProjectsSetDefaultNetworkTierRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Project responseCallSettings = await client.GetAsync(request.Project, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetDefaultNetworkTierAsync(request.Project, request.ProjectsSetDefaultNetworkTierRequestResource, st::CancellationToken.None); + Project responseCancellationToken = await client.GetAsync(request.Project, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void SetUsageExportBucketRequestObject() + public void GetXpnHostRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetUsageExportBucketProjectRequest request = new SetUsageExportBucketProjectRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); + GetXpnHostProjectRequest request = new GetXpnHostProjectRequest { - UsageExportLocationResource = new UsageExportLocation(), - RequestId = "request_id362c8df6", Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + Project expectedResponse = new Project { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Quotas = { new Quota(), }, + CommonInstanceMetadata = new Metadata(), + XpnProjectStatus = Project.Types.XpnProjectStatus.Host, + DefaultServiceAccount = "default_service_accountdf12b0f2", + UsageExportLocation = new UsageExportLocation(), Description = "description2cf9da67", - InsertTime = "insert_time7467185a", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + EnabledFeatures = + { + "enabled_featuresf1f398e0", + }, + DefaultNetworkTier = Project.Types.DefaultNetworkTier.Premium, }; - mockGrpcClient.Setup(x => x.SetUsageExportBucket(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetXpnHost(request, moq::It.IsAny())).Returns(expectedResponse); ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetUsageExportBucket(request); + Project response = client.GetXpnHost(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task SetUsageExportBucketRequestObjectAsync() + public async stt::Task GetXpnHostRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetUsageExportBucketProjectRequest request = new SetUsageExportBucketProjectRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); + GetXpnHostProjectRequest request = new GetXpnHostProjectRequest { - UsageExportLocationResource = new UsageExportLocation(), - RequestId = "request_id362c8df6", Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + Project expectedResponse = new Project { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Quotas = { new Quota(), }, + CommonInstanceMetadata = new Metadata(), + XpnProjectStatus = Project.Types.XpnProjectStatus.Host, + DefaultServiceAccount = "default_service_accountdf12b0f2", + UsageExportLocation = new UsageExportLocation(), Description = "description2cf9da67", - InsertTime = "insert_time7467185a", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + EnabledFeatures = + { + "enabled_featuresf1f398e0", + }, + DefaultNetworkTier = Project.Types.DefaultNetworkTier.Premium, }; - mockGrpcClient.Setup(x => x.SetUsageExportBucketAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetXpnHostAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetUsageExportBucketAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Project responseCallSettings = await client.GetXpnHostAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetUsageExportBucketAsync(request, st::CancellationToken.None); + Project responseCancellationToken = await client.GetXpnHostAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void SetUsageExportBucket() + public void GetXpnHost() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetUsageExportBucketProjectRequest request = new SetUsageExportBucketProjectRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); + GetXpnHostProjectRequest request = new GetXpnHostProjectRequest { - UsageExportLocationResource = new UsageExportLocation(), Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + Project expectedResponse = new Project { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Quotas = { new Quota(), }, + CommonInstanceMetadata = new Metadata(), + XpnProjectStatus = Project.Types.XpnProjectStatus.Host, + DefaultServiceAccount = "default_service_accountdf12b0f2", + UsageExportLocation = new UsageExportLocation(), Description = "description2cf9da67", - InsertTime = "insert_time7467185a", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + EnabledFeatures = + { + "enabled_featuresf1f398e0", + }, + DefaultNetworkTier = Project.Types.DefaultNetworkTier.Premium, }; - mockGrpcClient.Setup(x => x.SetUsageExportBucket(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetXpnHost(request, moq::It.IsAny())).Returns(expectedResponse); ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetUsageExportBucket(request.Project, request.UsageExportLocationResource); + Project response = client.GetXpnHost(request.Project); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task SetUsageExportBucketAsync() + public async stt::Task GetXpnHostAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetUsageExportBucketProjectRequest request = new SetUsageExportBucketProjectRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); + GetXpnHostProjectRequest request = new GetXpnHostProjectRequest { - UsageExportLocationResource = new UsageExportLocation(), Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + Project expectedResponse = new Project { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Quotas = { new Quota(), }, + CommonInstanceMetadata = new Metadata(), + XpnProjectStatus = Project.Types.XpnProjectStatus.Host, + DefaultServiceAccount = "default_service_accountdf12b0f2", + UsageExportLocation = new UsageExportLocation(), Description = "description2cf9da67", - InsertTime = "insert_time7467185a", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + EnabledFeatures = + { + "enabled_featuresf1f398e0", + }, + DefaultNetworkTier = Project.Types.DefaultNetworkTier.Premium, }; - mockGrpcClient.Setup(x => x.SetUsageExportBucketAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetXpnHostAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); ProjectsClient client = new ProjectsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetUsageExportBucketAsync(request.Project, request.UsageExportLocationResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Project responseCallSettings = await client.GetXpnHostAsync(request.Project, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetUsageExportBucketAsync(request.Project, request.UsageExportLocationResource, st::CancellationToken.None); + Project responseCancellationToken = await client.GetXpnHostAsync(request.Project, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/PublicAdvertisedPrefixesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/PublicAdvertisedPrefixesClientTest.g.cs index a57e3a5d2ef5..2eb78ebc30a5 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/PublicAdvertisedPrefixesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/PublicAdvertisedPrefixesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,188 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedPublicAdvertisedPrefixesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeletePublicAdvertisedPrefixeRequest request = new DeletePublicAdvertisedPrefixeRequest - { - RequestId = "request_id362c8df6", - PublicAdvertisedPrefix = "public_advertised_prefix53682ff1", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - PublicAdvertisedPrefixesClient client = new PublicAdvertisedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeletePublicAdvertisedPrefixeRequest request = new DeletePublicAdvertisedPrefixeRequest - { - RequestId = "request_id362c8df6", - PublicAdvertisedPrefix = "public_advertised_prefix53682ff1", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - PublicAdvertisedPrefixesClient client = new PublicAdvertisedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeletePublicAdvertisedPrefixeRequest request = new DeletePublicAdvertisedPrefixeRequest - { - PublicAdvertisedPrefix = "public_advertised_prefix53682ff1", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - PublicAdvertisedPrefixesClient client = new PublicAdvertisedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.PublicAdvertisedPrefix); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeletePublicAdvertisedPrefixeRequest request = new DeletePublicAdvertisedPrefixeRequest - { - PublicAdvertisedPrefix = "public_advertised_prefix53682ff1", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - PublicAdvertisedPrefixesClient client = new PublicAdvertisedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.PublicAdvertisedPrefix, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.PublicAdvertisedPrefix, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetPublicAdvertisedPrefixeRequest request = new GetPublicAdvertisedPrefixeRequest { PublicAdvertisedPrefix = "public_advertised_prefix53682ff1", @@ -242,6 +66,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetPublicAdvertisedPrefixeRequest request = new GetPublicAdvertisedPrefixeRequest { PublicAdvertisedPrefix = "public_advertised_prefix53682ff1", @@ -278,6 +103,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetPublicAdvertisedPrefixeRequest request = new GetPublicAdvertisedPrefixeRequest { PublicAdvertisedPrefix = "public_advertised_prefix53682ff1", @@ -312,6 +138,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetPublicAdvertisedPrefixeRequest request = new GetPublicAdvertisedPrefixeRequest { PublicAdvertisedPrefix = "public_advertised_prefix53682ff1", @@ -343,365 +170,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertPublicAdvertisedPrefixeRequest request = new InsertPublicAdvertisedPrefixeRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - PublicAdvertisedPrefixResource = new PublicAdvertisedPrefix(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - PublicAdvertisedPrefixesClient client = new PublicAdvertisedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertPublicAdvertisedPrefixeRequest request = new InsertPublicAdvertisedPrefixeRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - PublicAdvertisedPrefixResource = new PublicAdvertisedPrefix(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - PublicAdvertisedPrefixesClient client = new PublicAdvertisedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertPublicAdvertisedPrefixeRequest request = new InsertPublicAdvertisedPrefixeRequest - { - Project = "projectaa6ff846", - PublicAdvertisedPrefixResource = new PublicAdvertisedPrefix(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - PublicAdvertisedPrefixesClient client = new PublicAdvertisedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.PublicAdvertisedPrefixResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertPublicAdvertisedPrefixeRequest request = new InsertPublicAdvertisedPrefixeRequest - { - Project = "projectaa6ff846", - PublicAdvertisedPrefixResource = new PublicAdvertisedPrefix(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - PublicAdvertisedPrefixesClient client = new PublicAdvertisedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.PublicAdvertisedPrefixResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.PublicAdvertisedPrefixResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchPublicAdvertisedPrefixeRequest request = new PatchPublicAdvertisedPrefixeRequest - { - RequestId = "request_id362c8df6", - PublicAdvertisedPrefix = "public_advertised_prefix53682ff1", - Project = "projectaa6ff846", - PublicAdvertisedPrefixResource = new PublicAdvertisedPrefix(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - PublicAdvertisedPrefixesClient client = new PublicAdvertisedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchPublicAdvertisedPrefixeRequest request = new PatchPublicAdvertisedPrefixeRequest - { - RequestId = "request_id362c8df6", - PublicAdvertisedPrefix = "public_advertised_prefix53682ff1", - Project = "projectaa6ff846", - PublicAdvertisedPrefixResource = new PublicAdvertisedPrefix(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - PublicAdvertisedPrefixesClient client = new PublicAdvertisedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchPublicAdvertisedPrefixeRequest request = new PatchPublicAdvertisedPrefixeRequest - { - PublicAdvertisedPrefix = "public_advertised_prefix53682ff1", - Project = "projectaa6ff846", - PublicAdvertisedPrefixResource = new PublicAdvertisedPrefix(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - PublicAdvertisedPrefixesClient client = new PublicAdvertisedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.PublicAdvertisedPrefix, request.PublicAdvertisedPrefixResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchPublicAdvertisedPrefixeRequest request = new PatchPublicAdvertisedPrefixeRequest - { - PublicAdvertisedPrefix = "public_advertised_prefix53682ff1", - Project = "projectaa6ff846", - PublicAdvertisedPrefixResource = new PublicAdvertisedPrefix(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - PublicAdvertisedPrefixesClient client = new PublicAdvertisedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.PublicAdvertisedPrefix, request.PublicAdvertisedPrefixResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.PublicAdvertisedPrefix, request.PublicAdvertisedPrefixResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/PublicDelegatedPrefixesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/PublicDelegatedPrefixesClientTest.g.cs index eef135d983ba..36277d3c326d 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/PublicDelegatedPrefixesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/PublicDelegatedPrefixesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedPublicDelegatedPrefixesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeletePublicDelegatedPrefixeRequest request = new DeletePublicDelegatedPrefixeRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - PublicDelegatedPrefix = "public_delegated_prefixff04d704", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - PublicDelegatedPrefixesClient client = new PublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeletePublicDelegatedPrefixeRequest request = new DeletePublicDelegatedPrefixeRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - PublicDelegatedPrefix = "public_delegated_prefixff04d704", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - PublicDelegatedPrefixesClient client = new PublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeletePublicDelegatedPrefixeRequest request = new DeletePublicDelegatedPrefixeRequest - { - Region = "regionedb20d96", - PublicDelegatedPrefix = "public_delegated_prefixff04d704", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - PublicDelegatedPrefixesClient client = new PublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.PublicDelegatedPrefix); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeletePublicDelegatedPrefixeRequest request = new DeletePublicDelegatedPrefixeRequest - { - Region = "regionedb20d96", - PublicDelegatedPrefix = "public_delegated_prefixff04d704", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - PublicDelegatedPrefixesClient client = new PublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.PublicDelegatedPrefix, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.PublicDelegatedPrefix, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetPublicDelegatedPrefixeRequest request = new GetPublicDelegatedPrefixeRequest { Region = "regionedb20d96", @@ -248,6 +68,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetPublicDelegatedPrefixeRequest request = new GetPublicDelegatedPrefixeRequest { Region = "regionedb20d96", @@ -286,6 +107,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetPublicDelegatedPrefixeRequest request = new GetPublicDelegatedPrefixeRequest { Region = "regionedb20d96", @@ -322,6 +144,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetPublicDelegatedPrefixeRequest request = new GetPublicDelegatedPrefixeRequest { Region = "regionedb20d96", @@ -355,373 +178,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertPublicDelegatedPrefixeRequest request = new InsertPublicDelegatedPrefixeRequest - { - RequestId = "request_id362c8df6", - PublicDelegatedPrefixResource = new PublicDelegatedPrefix(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - PublicDelegatedPrefixesClient client = new PublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertPublicDelegatedPrefixeRequest request = new InsertPublicDelegatedPrefixeRequest - { - RequestId = "request_id362c8df6", - PublicDelegatedPrefixResource = new PublicDelegatedPrefix(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - PublicDelegatedPrefixesClient client = new PublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertPublicDelegatedPrefixeRequest request = new InsertPublicDelegatedPrefixeRequest - { - PublicDelegatedPrefixResource = new PublicDelegatedPrefix(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - PublicDelegatedPrefixesClient client = new PublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.PublicDelegatedPrefixResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertPublicDelegatedPrefixeRequest request = new InsertPublicDelegatedPrefixeRequest - { - PublicDelegatedPrefixResource = new PublicDelegatedPrefix(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - PublicDelegatedPrefixesClient client = new PublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.PublicDelegatedPrefixResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.PublicDelegatedPrefixResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchPublicDelegatedPrefixeRequest request = new PatchPublicDelegatedPrefixeRequest - { - RequestId = "request_id362c8df6", - PublicDelegatedPrefixResource = new PublicDelegatedPrefix(), - Region = "regionedb20d96", - PublicDelegatedPrefix = "public_delegated_prefixff04d704", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - PublicDelegatedPrefixesClient client = new PublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchPublicDelegatedPrefixeRequest request = new PatchPublicDelegatedPrefixeRequest - { - RequestId = "request_id362c8df6", - PublicDelegatedPrefixResource = new PublicDelegatedPrefix(), - Region = "regionedb20d96", - PublicDelegatedPrefix = "public_delegated_prefixff04d704", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - PublicDelegatedPrefixesClient client = new PublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchPublicDelegatedPrefixeRequest request = new PatchPublicDelegatedPrefixeRequest - { - PublicDelegatedPrefixResource = new PublicDelegatedPrefix(), - Region = "regionedb20d96", - PublicDelegatedPrefix = "public_delegated_prefixff04d704", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - PublicDelegatedPrefixesClient client = new PublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.Region, request.PublicDelegatedPrefix, request.PublicDelegatedPrefixResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchPublicDelegatedPrefixeRequest request = new PatchPublicDelegatedPrefixeRequest - { - PublicDelegatedPrefixResource = new PublicDelegatedPrefix(), - Region = "regionedb20d96", - PublicDelegatedPrefix = "public_delegated_prefixff04d704", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - PublicDelegatedPrefixesClient client = new PublicDelegatedPrefixesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.Region, request.PublicDelegatedPrefix, request.PublicDelegatedPrefixResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.Region, request.PublicDelegatedPrefix, request.PublicDelegatedPrefixResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionAutoscalersClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionAutoscalersClientTest.g.cs index a1fdb3e58c4a..7f9f6361babd 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionAutoscalersClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionAutoscalersClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedRegionAutoscalersClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionAutoscalerRequest request = new DeleteRegionAutoscalerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - Autoscaler = "autoscaleradfcda44", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionAutoscalersClient client = new RegionAutoscalersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionAutoscalerRequest request = new DeleteRegionAutoscalerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - Autoscaler = "autoscaleradfcda44", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionAutoscalersClient client = new RegionAutoscalersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionAutoscalerRequest request = new DeleteRegionAutoscalerRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - Autoscaler = "autoscaleradfcda44", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionAutoscalersClient client = new RegionAutoscalersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.Autoscaler); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionAutoscalerRequest request = new DeleteRegionAutoscalerRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - Autoscaler = "autoscaleradfcda44", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionAutoscalersClient client = new RegionAutoscalersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.Autoscaler, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.Autoscaler, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionAutoscalerRequest request = new GetRegionAutoscalerRequest { Region = "regionedb20d96", @@ -255,6 +75,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionAutoscalerRequest request = new GetRegionAutoscalerRequest { Region = "regionedb20d96", @@ -300,6 +121,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionAutoscalerRequest request = new GetRegionAutoscalerRequest { Region = "regionedb20d96", @@ -343,6 +165,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionAutoscalerRequest request = new GetRegionAutoscalerRequest { Region = "regionedb20d96", @@ -383,555 +206,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionAutoscalerRequest request = new InsertRegionAutoscalerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionAutoscalersClient client = new RegionAutoscalersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionAutoscalerRequest request = new InsertRegionAutoscalerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionAutoscalersClient client = new RegionAutoscalersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionAutoscalerRequest request = new InsertRegionAutoscalerRequest - { - Region = "regionedb20d96", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionAutoscalersClient client = new RegionAutoscalersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.AutoscalerResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionAutoscalerRequest request = new InsertRegionAutoscalerRequest - { - Region = "regionedb20d96", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionAutoscalersClient client = new RegionAutoscalersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.AutoscalerResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.AutoscalerResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionAutoscalerRequest request = new PatchRegionAutoscalerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - Autoscaler = "autoscaleradfcda44", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - RegionAutoscalersClient client = new RegionAutoscalersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionAutoscalerRequest request = new PatchRegionAutoscalerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - Autoscaler = "autoscaleradfcda44", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionAutoscalersClient client = new RegionAutoscalersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionAutoscalerRequest request = new PatchRegionAutoscalerRequest - { - Region = "regionedb20d96", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - RegionAutoscalersClient client = new RegionAutoscalersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.Region, request.AutoscalerResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionAutoscalerRequest request = new PatchRegionAutoscalerRequest - { - Region = "regionedb20d96", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionAutoscalersClient client = new RegionAutoscalersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.Region, request.AutoscalerResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.Region, request.AutoscalerResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void UpdateRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateRegionAutoscalerRequest request = new UpdateRegionAutoscalerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - Autoscaler = "autoscaleradfcda44", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); - RegionAutoscalersClient client = new RegionAutoscalersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task UpdateRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateRegionAutoscalerRequest request = new UpdateRegionAutoscalerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - Autoscaler = "autoscaleradfcda44", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionAutoscalersClient client = new RegionAutoscalersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Update() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateRegionAutoscalerRequest request = new UpdateRegionAutoscalerRequest - { - Region = "regionedb20d96", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); - RegionAutoscalersClient client = new RegionAutoscalersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request.Project, request.Region, request.AutoscalerResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task UpdateAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateRegionAutoscalerRequest request = new UpdateRegionAutoscalerRequest - { - Region = "regionedb20d96", - AutoscalerResource = new Autoscaler(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionAutoscalersClient client = new RegionAutoscalersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request.Project, request.Region, request.AutoscalerResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request.Project, request.Region, request.AutoscalerResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionBackendServicesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionBackendServicesClientTest.g.cs index 22ed3c048479..f87f716dee09 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionBackendServicesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionBackendServicesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedRegionBackendServicesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionBackendServiceRequest request = new DeleteRegionBackendServiceRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionBackendServicesClient client = new RegionBackendServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionBackendServiceRequest request = new DeleteRegionBackendServiceRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionBackendServicesClient client = new RegionBackendServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionBackendServiceRequest request = new DeleteRegionBackendServiceRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionBackendServicesClient client = new RegionBackendServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.BackendService); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionBackendServiceRequest request = new DeleteRegionBackendServiceRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionBackendServicesClient client = new RegionBackendServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.BackendService, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.BackendService, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionBackendServiceRequest request = new GetRegionBackendServiceRequest { Region = "regionedb20d96", @@ -274,6 +94,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionBackendServiceRequest request = new GetRegionBackendServiceRequest { Region = "regionedb20d96", @@ -338,6 +159,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionBackendServiceRequest request = new GetRegionBackendServiceRequest { Region = "regionedb20d96", @@ -400,6 +222,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionBackendServiceRequest request = new GetRegionBackendServiceRequest { Region = "regionedb20d96", @@ -464,6 +287,7 @@ public void Get() public void GetHealthRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetHealthRegionBackendServiceRequest request = new GetHealthRegionBackendServiceRequest { ResourceGroupReferenceResource = new ResourceGroupReference(), @@ -494,6 +318,7 @@ public void GetHealthRequestObject() public async stt::Task GetHealthRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetHealthRegionBackendServiceRequest request = new GetHealthRegionBackendServiceRequest { ResourceGroupReferenceResource = new ResourceGroupReference(), @@ -526,6 +351,7 @@ public void GetHealthRequestObject() public void GetHealth() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetHealthRegionBackendServiceRequest request = new GetHealthRegionBackendServiceRequest { ResourceGroupReferenceResource = new ResourceGroupReference(), @@ -556,6 +382,7 @@ public void GetHealth() public async stt::Task GetHealthAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetHealthRegionBackendServiceRequest request = new GetHealthRegionBackendServiceRequest { ResourceGroupReferenceResource = new ResourceGroupReference(), @@ -583,559 +410,5 @@ public void GetHealth() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionBackendServiceRequest request = new InsertRegionBackendServiceRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - BackendServiceResource = new BackendService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionBackendServicesClient client = new RegionBackendServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionBackendServiceRequest request = new InsertRegionBackendServiceRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - BackendServiceResource = new BackendService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionBackendServicesClient client = new RegionBackendServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionBackendServiceRequest request = new InsertRegionBackendServiceRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - BackendServiceResource = new BackendService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionBackendServicesClient client = new RegionBackendServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.BackendServiceResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionBackendServiceRequest request = new InsertRegionBackendServiceRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - BackendServiceResource = new BackendService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionBackendServicesClient client = new RegionBackendServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.BackendServiceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.BackendServiceResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionBackendServiceRequest request = new PatchRegionBackendServiceRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - BackendServiceResource = new BackendService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - RegionBackendServicesClient client = new RegionBackendServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionBackendServiceRequest request = new PatchRegionBackendServiceRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - BackendServiceResource = new BackendService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionBackendServicesClient client = new RegionBackendServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionBackendServiceRequest request = new PatchRegionBackendServiceRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - BackendServiceResource = new BackendService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - RegionBackendServicesClient client = new RegionBackendServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.Region, request.BackendService, request.BackendServiceResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionBackendServiceRequest request = new PatchRegionBackendServiceRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - BackendServiceResource = new BackendService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionBackendServicesClient client = new RegionBackendServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.Region, request.BackendService, request.BackendServiceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.Region, request.BackendService, request.BackendServiceResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void UpdateRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateRegionBackendServiceRequest request = new UpdateRegionBackendServiceRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - BackendServiceResource = new BackendService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); - RegionBackendServicesClient client = new RegionBackendServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task UpdateRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateRegionBackendServiceRequest request = new UpdateRegionBackendServiceRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - BackendServiceResource = new BackendService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionBackendServicesClient client = new RegionBackendServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Update() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateRegionBackendServiceRequest request = new UpdateRegionBackendServiceRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - BackendServiceResource = new BackendService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); - RegionBackendServicesClient client = new RegionBackendServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request.Project, request.Region, request.BackendService, request.BackendServiceResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task UpdateAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateRegionBackendServiceRequest request = new UpdateRegionBackendServiceRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - BackendService = "backend_serviceed490d45", - BackendServiceResource = new BackendService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionBackendServicesClient client = new RegionBackendServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request.Project, request.Region, request.BackendService, request.BackendServiceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request.Project, request.Region, request.BackendService, request.BackendServiceResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionCommitmentsClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionCommitmentsClientTest.g.cs index 112beacda552..b3c0a6d83fc2 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionCommitmentsClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionCommitmentsClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -30,6 +31,7 @@ public sealed class GeneratedRegionCommitmentsClientTest public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionCommitmentRequest request = new GetRegionCommitmentRequest { Region = "regionedb20d96", @@ -69,6 +71,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionCommitmentRequest request = new GetRegionCommitmentRequest { Region = "regionedb20d96", @@ -110,6 +113,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionCommitmentRequest request = new GetRegionCommitmentRequest { Region = "regionedb20d96", @@ -149,6 +153,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionCommitmentRequest request = new GetRegionCommitmentRequest { Region = "regionedb20d96", @@ -185,187 +190,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionCommitmentRequest request = new InsertRegionCommitmentRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - CommitmentResource = new Commitment(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionCommitmentsClient client = new RegionCommitmentsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionCommitmentRequest request = new InsertRegionCommitmentRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - CommitmentResource = new Commitment(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionCommitmentsClient client = new RegionCommitmentsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionCommitmentRequest request = new InsertRegionCommitmentRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - CommitmentResource = new Commitment(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionCommitmentsClient client = new RegionCommitmentsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.CommitmentResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionCommitmentRequest request = new InsertRegionCommitmentRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - CommitmentResource = new Commitment(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionCommitmentsClient client = new RegionCommitmentsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.CommitmentResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.CommitmentResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionDisksClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionDisksClientTest.g.cs index 1165c08115bc..fce5c9bfc160 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionDisksClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionDisksClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -27,1547 +28,332 @@ namespace Google.Cloud.Compute.V1.Tests public sealed class GeneratedRegionDisksClientTest { [xunit::FactAttribute] - public void AddResourcePoliciesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddResourcePoliciesRegionDiskRequest request = new AddResourcePoliciesRegionDiskRequest - { - Disk = "disk028b6875", - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - RegionDisksAddResourcePoliciesRequestResource = new RegionDisksAddResourcePoliciesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddResourcePolicies(request, moq::It.IsAny())).Returns(expectedResponse); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddResourcePolicies(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddResourcePoliciesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddResourcePoliciesRegionDiskRequest request = new AddResourcePoliciesRegionDiskRequest - { - Disk = "disk028b6875", - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - RegionDisksAddResourcePoliciesRequestResource = new RegionDisksAddResourcePoliciesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddResourcePoliciesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddResourcePoliciesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddResourcePoliciesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void AddResourcePolicies() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddResourcePoliciesRegionDiskRequest request = new AddResourcePoliciesRegionDiskRequest - { - Disk = "disk028b6875", - Region = "regionedb20d96", - Project = "projectaa6ff846", - RegionDisksAddResourcePoliciesRequestResource = new RegionDisksAddResourcePoliciesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddResourcePolicies(request, moq::It.IsAny())).Returns(expectedResponse); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddResourcePolicies(request.Project, request.Region, request.Disk, request.RegionDisksAddResourcePoliciesRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddResourcePoliciesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddResourcePoliciesRegionDiskRequest request = new AddResourcePoliciesRegionDiskRequest - { - Disk = "disk028b6875", - Region = "regionedb20d96", - Project = "projectaa6ff846", - RegionDisksAddResourcePoliciesRequestResource = new RegionDisksAddResourcePoliciesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddResourcePoliciesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddResourcePoliciesAsync(request.Project, request.Region, request.Disk, request.RegionDisksAddResourcePoliciesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddResourcePoliciesAsync(request.Project, request.Region, request.Disk, request.RegionDisksAddResourcePoliciesRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void CreateSnapshotRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - CreateSnapshotRegionDiskRequest request = new CreateSnapshotRegionDiskRequest - { - Disk = "disk028b6875", - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - SnapshotResource = new Snapshot(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.CreateSnapshot(request, moq::It.IsAny())).Returns(expectedResponse); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.CreateSnapshot(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task CreateSnapshotRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - CreateSnapshotRegionDiskRequest request = new CreateSnapshotRegionDiskRequest - { - Disk = "disk028b6875", - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - SnapshotResource = new Snapshot(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.CreateSnapshotAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.CreateSnapshotAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.CreateSnapshotAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void CreateSnapshot() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - CreateSnapshotRegionDiskRequest request = new CreateSnapshotRegionDiskRequest - { - Disk = "disk028b6875", - Region = "regionedb20d96", - Project = "projectaa6ff846", - SnapshotResource = new Snapshot(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.CreateSnapshot(request, moq::It.IsAny())).Returns(expectedResponse); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.CreateSnapshot(request.Project, request.Region, request.Disk, request.SnapshotResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task CreateSnapshotAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - CreateSnapshotRegionDiskRequest request = new CreateSnapshotRegionDiskRequest - { - Disk = "disk028b6875", - Region = "regionedb20d96", - Project = "projectaa6ff846", - SnapshotResource = new Snapshot(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.CreateSnapshotAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.CreateSnapshotAsync(request.Project, request.Region, request.Disk, request.SnapshotResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.CreateSnapshotAsync(request.Project, request.Region, request.Disk, request.SnapshotResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionDiskRequest request = new DeleteRegionDiskRequest - { - Disk = "disk028b6875", - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionDiskRequest request = new DeleteRegionDiskRequest - { - Disk = "disk028b6875", - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionDiskRequest request = new DeleteRegionDiskRequest - { - Disk = "disk028b6875", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.Disk); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionDiskRequest request = new DeleteRegionDiskRequest - { - Disk = "disk028b6875", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.Disk, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.Disk, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetRegionDiskRequest request = new GetRegionDiskRequest - { - Disk = "disk028b6875", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Disk expectedResponse = new Disk - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Type = "typee2cc9d59", - Zone = "zone255f4ea8", - ResourcePolicies = - { - "resource_policiesdff15734", - }, - CreationTimestamp = "creation_timestamp235e59a1", - LastAttachTimestamp = "last_attach_timestamp4fe3fe94", - LicenseCodes = - { - -3549522739643304114L, - }, - ReplicaZones = - { - "replica_zonesc1977354", - }, - SourceImage = "source_image5e9c0c38", - SourceImageId = "source_image_id954b5e55", - LastDetachTimestamp = "last_detach_timestampffef196b", - GuestOsFeatures = - { - new GuestOsFeature(), - }, - SourceSnapshotId = "source_snapshot_id008ab5dd", - Users = { "users2a5cc69b", }, - SourceSnapshot = "source_snapshot1fcf3da1", - Region = "regionedb20d96", - LabelFingerprint = "label_fingerprint06ccff3a", - Status = Disk.Types.Status.Deleting, - ProvisionedIops = -3779563869670119518L, - SourceStorageObject = "source_storage_object4e059972", - DiskEncryptionKey = new CustomerEncryptionKey(), - SourceSnapshotEncryptionKey = new CustomerEncryptionKey(), - Licenses = - { - "licensesd1cc2f9d", - }, - LocationHint = "location_hint666f366c", - Options = "optionsa965da93", - SourceImageEncryptionKey = new CustomerEncryptionKey(), - PhysicalBlockSizeBytes = -7292518380745299537L, - Description = "description2cf9da67", - SourceDisk = "source_disk0eec086f", - SourceDiskId = "source_disk_id020f9fb8", - SelfLink = "self_link7e87f12d", - SatisfiesPzs = false, - SizeGb = -3653169847519542788L, - Labels = - { - { - "key8a0b6e3c", - "value60c16320" - }, - }, - }; - mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Disk response = client.Get(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetRegionDiskRequest request = new GetRegionDiskRequest - { - Disk = "disk028b6875", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Disk expectedResponse = new Disk - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Type = "typee2cc9d59", - Zone = "zone255f4ea8", - ResourcePolicies = - { - "resource_policiesdff15734", - }, - CreationTimestamp = "creation_timestamp235e59a1", - LastAttachTimestamp = "last_attach_timestamp4fe3fe94", - LicenseCodes = - { - -3549522739643304114L, - }, - ReplicaZones = - { - "replica_zonesc1977354", - }, - SourceImage = "source_image5e9c0c38", - SourceImageId = "source_image_id954b5e55", - LastDetachTimestamp = "last_detach_timestampffef196b", - GuestOsFeatures = - { - new GuestOsFeature(), - }, - SourceSnapshotId = "source_snapshot_id008ab5dd", - Users = { "users2a5cc69b", }, - SourceSnapshot = "source_snapshot1fcf3da1", - Region = "regionedb20d96", - LabelFingerprint = "label_fingerprint06ccff3a", - Status = Disk.Types.Status.Deleting, - ProvisionedIops = -3779563869670119518L, - SourceStorageObject = "source_storage_object4e059972", - DiskEncryptionKey = new CustomerEncryptionKey(), - SourceSnapshotEncryptionKey = new CustomerEncryptionKey(), - Licenses = - { - "licensesd1cc2f9d", - }, - LocationHint = "location_hint666f366c", - Options = "optionsa965da93", - SourceImageEncryptionKey = new CustomerEncryptionKey(), - PhysicalBlockSizeBytes = -7292518380745299537L, - Description = "description2cf9da67", - SourceDisk = "source_disk0eec086f", - SourceDiskId = "source_disk_id020f9fb8", - SelfLink = "self_link7e87f12d", - SatisfiesPzs = false, - SizeGb = -3653169847519542788L, - Labels = - { - { - "key8a0b6e3c", - "value60c16320" - }, - }, - }; - mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Disk responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Disk responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Get() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetRegionDiskRequest request = new GetRegionDiskRequest - { - Disk = "disk028b6875", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Disk expectedResponse = new Disk - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Type = "typee2cc9d59", - Zone = "zone255f4ea8", - ResourcePolicies = - { - "resource_policiesdff15734", - }, - CreationTimestamp = "creation_timestamp235e59a1", - LastAttachTimestamp = "last_attach_timestamp4fe3fe94", - LicenseCodes = - { - -3549522739643304114L, - }, - ReplicaZones = - { - "replica_zonesc1977354", - }, - SourceImage = "source_image5e9c0c38", - SourceImageId = "source_image_id954b5e55", - LastDetachTimestamp = "last_detach_timestampffef196b", - GuestOsFeatures = - { - new GuestOsFeature(), - }, - SourceSnapshotId = "source_snapshot_id008ab5dd", - Users = { "users2a5cc69b", }, - SourceSnapshot = "source_snapshot1fcf3da1", - Region = "regionedb20d96", - LabelFingerprint = "label_fingerprint06ccff3a", - Status = Disk.Types.Status.Deleting, - ProvisionedIops = -3779563869670119518L, - SourceStorageObject = "source_storage_object4e059972", - DiskEncryptionKey = new CustomerEncryptionKey(), - SourceSnapshotEncryptionKey = new CustomerEncryptionKey(), - Licenses = - { - "licensesd1cc2f9d", - }, - LocationHint = "location_hint666f366c", - Options = "optionsa965da93", - SourceImageEncryptionKey = new CustomerEncryptionKey(), - PhysicalBlockSizeBytes = -7292518380745299537L, - Description = "description2cf9da67", - SourceDisk = "source_disk0eec086f", - SourceDiskId = "source_disk_id020f9fb8", - SelfLink = "self_link7e87f12d", - SatisfiesPzs = false, - SizeGb = -3653169847519542788L, - Labels = - { - { - "key8a0b6e3c", - "value60c16320" - }, - }, - }; - mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Disk response = client.Get(request.Project, request.Region, request.Disk); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetRegionDiskRequest request = new GetRegionDiskRequest - { - Disk = "disk028b6875", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Disk expectedResponse = new Disk - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Type = "typee2cc9d59", - Zone = "zone255f4ea8", - ResourcePolicies = - { - "resource_policiesdff15734", - }, - CreationTimestamp = "creation_timestamp235e59a1", - LastAttachTimestamp = "last_attach_timestamp4fe3fe94", - LicenseCodes = - { - -3549522739643304114L, - }, - ReplicaZones = - { - "replica_zonesc1977354", - }, - SourceImage = "source_image5e9c0c38", - SourceImageId = "source_image_id954b5e55", - LastDetachTimestamp = "last_detach_timestampffef196b", - GuestOsFeatures = - { - new GuestOsFeature(), - }, - SourceSnapshotId = "source_snapshot_id008ab5dd", - Users = { "users2a5cc69b", }, - SourceSnapshot = "source_snapshot1fcf3da1", - Region = "regionedb20d96", - LabelFingerprint = "label_fingerprint06ccff3a", - Status = Disk.Types.Status.Deleting, - ProvisionedIops = -3779563869670119518L, - SourceStorageObject = "source_storage_object4e059972", - DiskEncryptionKey = new CustomerEncryptionKey(), - SourceSnapshotEncryptionKey = new CustomerEncryptionKey(), - Licenses = - { - "licensesd1cc2f9d", - }, - LocationHint = "location_hint666f366c", - Options = "optionsa965da93", - SourceImageEncryptionKey = new CustomerEncryptionKey(), - PhysicalBlockSizeBytes = -7292518380745299537L, - Description = "description2cf9da67", - SourceDisk = "source_disk0eec086f", - SourceDiskId = "source_disk_id020f9fb8", - SelfLink = "self_link7e87f12d", - SatisfiesPzs = false, - SizeGb = -3653169847519542788L, - Labels = - { - { - "key8a0b6e3c", - "value60c16320" - }, - }, - }; - mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Disk responseCallSettings = await client.GetAsync(request.Project, request.Region, request.Disk, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Disk responseCancellationToken = await client.GetAsync(request.Project, request.Region, request.Disk, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetIamPolicyRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetIamPolicyRegionDiskRequest request = new GetIamPolicyRegionDiskRequest - { - Region = "regionedb20d96", - Resource = "resource164eab96", - Project = "projectaa6ff846", - OptionsRequestedPolicyVersion = -1471234741, - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.GetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Policy response = client.GetIamPolicy(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetIamPolicyRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetIamPolicyRegionDiskRequest request = new GetIamPolicyRegionDiskRequest - { - Region = "regionedb20d96", - Resource = "resource164eab96", - Project = "projectaa6ff846", - OptionsRequestedPolicyVersion = -1471234741, - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.GetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Policy responseCallSettings = await client.GetIamPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Policy responseCancellationToken = await client.GetIamPolicyAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetIamPolicy() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetIamPolicyRegionDiskRequest request = new GetIamPolicyRegionDiskRequest - { - Region = "regionedb20d96", - Resource = "resource164eab96", - Project = "projectaa6ff846", - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.GetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Policy response = client.GetIamPolicy(request.Project, request.Region, request.Resource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetIamPolicyAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetIamPolicyRegionDiskRequest request = new GetIamPolicyRegionDiskRequest - { - Region = "regionedb20d96", - Resource = "resource164eab96", - Project = "projectaa6ff846", - }; - Policy expectedResponse = new Policy - { - Etag = "etage8ad7218", - Rules = { new Rule(), }, - AuditConfigs = { new AuditConfig(), }, - Version = 271578922, - Bindings = { new Binding(), }, - IamOwned = false, - }; - mockGrpcClient.Setup(x => x.GetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Policy responseCallSettings = await client.GetIamPolicyAsync(request.Project, request.Region, request.Resource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Policy responseCancellationToken = await client.GetIamPolicyAsync(request.Project, request.Region, request.Resource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionDiskRequest request = new InsertRegionDiskRequest - { - DiskResource = new Disk(), - RequestId = "request_id362c8df6", - SourceImage = "source_image5e9c0c38", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionDiskRequest request = new InsertRegionDiskRequest - { - DiskResource = new Disk(), - RequestId = "request_id362c8df6", - SourceImage = "source_image5e9c0c38", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionDiskRequest request = new InsertRegionDiskRequest - { - DiskResource = new Disk(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.DiskResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionDiskRequest request = new InsertRegionDiskRequest - { - DiskResource = new Disk(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.DiskResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.DiskResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void RemoveResourcePoliciesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveResourcePoliciesRegionDiskRequest request = new RemoveResourcePoliciesRegionDiskRequest - { - Disk = "disk028b6875", - RegionDisksRemoveResourcePoliciesRequestResource = new RegionDisksRemoveResourcePoliciesRequest(), - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveResourcePolicies(request, moq::It.IsAny())).Returns(expectedResponse); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.RemoveResourcePolicies(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task RemoveResourcePoliciesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveResourcePoliciesRegionDiskRequest request = new RemoveResourcePoliciesRegionDiskRequest - { - Disk = "disk028b6875", - RegionDisksRemoveResourcePoliciesRequestResource = new RegionDisksRemoveResourcePoliciesRequest(), - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveResourcePoliciesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RemoveResourcePoliciesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RemoveResourcePoliciesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void RemoveResourcePolicies() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveResourcePoliciesRegionDiskRequest request = new RemoveResourcePoliciesRegionDiskRequest - { - Disk = "disk028b6875", - RegionDisksRemoveResourcePoliciesRequestResource = new RegionDisksRemoveResourcePoliciesRequest(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveResourcePolicies(request, moq::It.IsAny())).Returns(expectedResponse); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.RemoveResourcePolicies(request.Project, request.Region, request.Disk, request.RegionDisksRemoveResourcePoliciesRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task RemoveResourcePoliciesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveResourcePoliciesRegionDiskRequest request = new RemoveResourcePoliciesRegionDiskRequest - { - Disk = "disk028b6875", - RegionDisksRemoveResourcePoliciesRequestResource = new RegionDisksRemoveResourcePoliciesRequest(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveResourcePoliciesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RemoveResourcePoliciesAsync(request.Project, request.Region, request.Disk, request.RegionDisksRemoveResourcePoliciesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RemoveResourcePoliciesAsync(request.Project, request.Region, request.Disk, request.RegionDisksRemoveResourcePoliciesRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void ResizeRequestObject() + public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResizeRegionDiskRequest request = new ResizeRegionDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + GetRegionDiskRequest request = new GetRegionDiskRequest { Disk = "disk028b6875", - RequestId = "request_id362c8df6", Region = "regionedb20d96", Project = "projectaa6ff846", - RegionDisksResizeRequestResource = new RegionDisksResizeRequest(), }; - Operation expectedResponse = new Operation + Disk expectedResponse = new Disk { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", + Type = "typee2cc9d59", Zone = "zone255f4ea8", + ResourcePolicies = + { + "resource_policiesdff15734", + }, CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + LastAttachTimestamp = "last_attach_timestamp4fe3fe94", + LicenseCodes = + { + -3549522739643304114L, + }, + ReplicaZones = + { + "replica_zonesc1977354", + }, + SourceImage = "source_image5e9c0c38", + SourceImageId = "source_image_id954b5e55", + LastDetachTimestamp = "last_detach_timestampffef196b", + GuestOsFeatures = + { + new GuestOsFeature(), + }, + SourceSnapshotId = "source_snapshot_id008ab5dd", + Users = { "users2a5cc69b", }, + SourceSnapshot = "source_snapshot1fcf3da1", Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + LabelFingerprint = "label_fingerprint06ccff3a", + Status = Disk.Types.Status.Deleting, + ProvisionedIops = -3779563869670119518L, + SourceStorageObject = "source_storage_object4e059972", + DiskEncryptionKey = new CustomerEncryptionKey(), + SourceSnapshotEncryptionKey = new CustomerEncryptionKey(), + Licenses = + { + "licensesd1cc2f9d", + }, + LocationHint = "location_hint666f366c", + Options = "optionsa965da93", + SourceImageEncryptionKey = new CustomerEncryptionKey(), + PhysicalBlockSizeBytes = -7292518380745299537L, Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + SourceDisk = "source_disk0eec086f", + SourceDiskId = "source_disk_id020f9fb8", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + SatisfiesPzs = false, + SizeGb = -3653169847519542788L, + Labels = + { + { + "key8a0b6e3c", + "value60c16320" + }, + }, }; - mockGrpcClient.Setup(x => x.Resize(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Resize(request); + Disk response = client.Get(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task ResizeRequestObjectAsync() + public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResizeRegionDiskRequest request = new ResizeRegionDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + GetRegionDiskRequest request = new GetRegionDiskRequest { Disk = "disk028b6875", - RequestId = "request_id362c8df6", Region = "regionedb20d96", Project = "projectaa6ff846", - RegionDisksResizeRequestResource = new RegionDisksResizeRequest(), }; - Operation expectedResponse = new Operation + Disk expectedResponse = new Disk { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", + Type = "typee2cc9d59", Zone = "zone255f4ea8", + ResourcePolicies = + { + "resource_policiesdff15734", + }, CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + LastAttachTimestamp = "last_attach_timestamp4fe3fe94", + LicenseCodes = + { + -3549522739643304114L, + }, + ReplicaZones = + { + "replica_zonesc1977354", + }, + SourceImage = "source_image5e9c0c38", + SourceImageId = "source_image_id954b5e55", + LastDetachTimestamp = "last_detach_timestampffef196b", + GuestOsFeatures = + { + new GuestOsFeature(), + }, + SourceSnapshotId = "source_snapshot_id008ab5dd", + Users = { "users2a5cc69b", }, + SourceSnapshot = "source_snapshot1fcf3da1", Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + LabelFingerprint = "label_fingerprint06ccff3a", + Status = Disk.Types.Status.Deleting, + ProvisionedIops = -3779563869670119518L, + SourceStorageObject = "source_storage_object4e059972", + DiskEncryptionKey = new CustomerEncryptionKey(), + SourceSnapshotEncryptionKey = new CustomerEncryptionKey(), + Licenses = + { + "licensesd1cc2f9d", + }, + LocationHint = "location_hint666f366c", + Options = "optionsa965da93", + SourceImageEncryptionKey = new CustomerEncryptionKey(), + PhysicalBlockSizeBytes = -7292518380745299537L, Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + SourceDisk = "source_disk0eec086f", + SourceDiskId = "source_disk_id020f9fb8", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + SatisfiesPzs = false, + SizeGb = -3653169847519542788L, + Labels = + { + { + "key8a0b6e3c", + "value60c16320" + }, + }, }; - mockGrpcClient.Setup(x => x.ResizeAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.ResizeAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Disk responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.ResizeAsync(request, st::CancellationToken.None); + Disk responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void Resize() + public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResizeRegionDiskRequest request = new ResizeRegionDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + GetRegionDiskRequest request = new GetRegionDiskRequest { Disk = "disk028b6875", Region = "regionedb20d96", Project = "projectaa6ff846", - RegionDisksResizeRequestResource = new RegionDisksResizeRequest(), }; - Operation expectedResponse = new Operation + Disk expectedResponse = new Disk { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", + Type = "typee2cc9d59", Zone = "zone255f4ea8", + ResourcePolicies = + { + "resource_policiesdff15734", + }, CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + LastAttachTimestamp = "last_attach_timestamp4fe3fe94", + LicenseCodes = + { + -3549522739643304114L, + }, + ReplicaZones = + { + "replica_zonesc1977354", + }, + SourceImage = "source_image5e9c0c38", + SourceImageId = "source_image_id954b5e55", + LastDetachTimestamp = "last_detach_timestampffef196b", + GuestOsFeatures = + { + new GuestOsFeature(), + }, + SourceSnapshotId = "source_snapshot_id008ab5dd", + Users = { "users2a5cc69b", }, + SourceSnapshot = "source_snapshot1fcf3da1", Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + LabelFingerprint = "label_fingerprint06ccff3a", + Status = Disk.Types.Status.Deleting, + ProvisionedIops = -3779563869670119518L, + SourceStorageObject = "source_storage_object4e059972", + DiskEncryptionKey = new CustomerEncryptionKey(), + SourceSnapshotEncryptionKey = new CustomerEncryptionKey(), + Licenses = + { + "licensesd1cc2f9d", + }, + LocationHint = "location_hint666f366c", + Options = "optionsa965da93", + SourceImageEncryptionKey = new CustomerEncryptionKey(), + PhysicalBlockSizeBytes = -7292518380745299537L, Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + SourceDisk = "source_disk0eec086f", + SourceDiskId = "source_disk_id020f9fb8", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + SatisfiesPzs = false, + SizeGb = -3653169847519542788L, + Labels = + { + { + "key8a0b6e3c", + "value60c16320" + }, + }, }; - mockGrpcClient.Setup(x => x.Resize(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Resize(request.Project, request.Region, request.Disk, request.RegionDisksResizeRequestResource); + Disk response = client.Get(request.Project, request.Region, request.Disk); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task ResizeAsync() + public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResizeRegionDiskRequest request = new ResizeRegionDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + GetRegionDiskRequest request = new GetRegionDiskRequest { Disk = "disk028b6875", Region = "regionedb20d96", Project = "projectaa6ff846", - RegionDisksResizeRequestResource = new RegionDisksResizeRequest(), }; - Operation expectedResponse = new Operation + Disk expectedResponse = new Disk { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", + Type = "typee2cc9d59", Zone = "zone255f4ea8", + ResourcePolicies = + { + "resource_policiesdff15734", + }, CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + LastAttachTimestamp = "last_attach_timestamp4fe3fe94", + LicenseCodes = + { + -3549522739643304114L, + }, + ReplicaZones = + { + "replica_zonesc1977354", + }, + SourceImage = "source_image5e9c0c38", + SourceImageId = "source_image_id954b5e55", + LastDetachTimestamp = "last_detach_timestampffef196b", + GuestOsFeatures = + { + new GuestOsFeature(), + }, + SourceSnapshotId = "source_snapshot_id008ab5dd", + Users = { "users2a5cc69b", }, + SourceSnapshot = "source_snapshot1fcf3da1", Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + LabelFingerprint = "label_fingerprint06ccff3a", + Status = Disk.Types.Status.Deleting, + ProvisionedIops = -3779563869670119518L, + SourceStorageObject = "source_storage_object4e059972", + DiskEncryptionKey = new CustomerEncryptionKey(), + SourceSnapshotEncryptionKey = new CustomerEncryptionKey(), + Licenses = + { + "licensesd1cc2f9d", + }, + LocationHint = "location_hint666f366c", + Options = "optionsa965da93", + SourceImageEncryptionKey = new CustomerEncryptionKey(), + PhysicalBlockSizeBytes = -7292518380745299537L, Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + SourceDisk = "source_disk0eec086f", + SourceDiskId = "source_disk_id020f9fb8", SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + SatisfiesPzs = false, + SizeGb = -3653169847519542788L, + Labels = + { + { + "key8a0b6e3c", + "value60c16320" + }, + }, }; - mockGrpcClient.Setup(x => x.ResizeAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.ResizeAsync(request.Project, request.Region, request.Disk, request.RegionDisksResizeRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Disk responseCallSettings = await client.GetAsync(request.Project, request.Region, request.Disk, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.ResizeAsync(request.Project, request.Region, request.Disk, request.RegionDisksResizeRequestResource, st::CancellationToken.None); + Disk responseCancellationToken = await client.GetAsync(request.Project, request.Region, request.Disk, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void SetIamPolicyRequestObject() + public void GetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetIamPolicyRegionDiskRequest request = new SetIamPolicyRegionDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + GetIamPolicyRegionDiskRequest request = new GetIamPolicyRegionDiskRequest { Region = "regionedb20d96", Resource = "resource164eab96", Project = "projectaa6ff846", - RegionSetPolicyRequestResource = new RegionSetPolicyRequest(), + OptionsRequestedPolicyVersion = -1471234741, }; Policy expectedResponse = new Policy { @@ -1578,23 +364,24 @@ public void SetIamPolicyRequestObject() Bindings = { new Binding(), }, IamOwned = false, }; - mockGrpcClient.Setup(x => x.SetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Policy response = client.SetIamPolicy(request); + Policy response = client.GetIamPolicy(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task SetIamPolicyRequestObjectAsync() + public async stt::Task GetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetIamPolicyRegionDiskRequest request = new SetIamPolicyRegionDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + GetIamPolicyRegionDiskRequest request = new GetIamPolicyRegionDiskRequest { Region = "regionedb20d96", Resource = "resource164eab96", Project = "projectaa6ff846", - RegionSetPolicyRequestResource = new RegionSetPolicyRequest(), + OptionsRequestedPolicyVersion = -1471234741, }; Policy expectedResponse = new Policy { @@ -1605,25 +392,25 @@ public void SetIamPolicyRequestObject() Bindings = { new Binding(), }, IamOwned = false, }; - mockGrpcClient.Setup(x => x.SetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Policy responseCallSettings = await client.SetIamPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Policy responseCallSettings = await client.GetIamPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Policy responseCancellationToken = await client.SetIamPolicyAsync(request, st::CancellationToken.None); + Policy responseCancellationToken = await client.GetIamPolicyAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void SetIamPolicy() + public void GetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetIamPolicyRegionDiskRequest request = new SetIamPolicyRegionDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + GetIamPolicyRegionDiskRequest request = new GetIamPolicyRegionDiskRequest { Region = "regionedb20d96", Resource = "resource164eab96", Project = "projectaa6ff846", - RegionSetPolicyRequestResource = new RegionSetPolicyRequest(), }; Policy expectedResponse = new Policy { @@ -1634,23 +421,23 @@ public void SetIamPolicy() Bindings = { new Binding(), }, IamOwned = false, }; - mockGrpcClient.Setup(x => x.SetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Policy response = client.SetIamPolicy(request.Project, request.Region, request.Resource, request.RegionSetPolicyRequestResource); + Policy response = client.GetIamPolicy(request.Project, request.Region, request.Resource); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task SetIamPolicyAsync() + public async stt::Task GetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetIamPolicyRegionDiskRequest request = new SetIamPolicyRegionDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + GetIamPolicyRegionDiskRequest request = new GetIamPolicyRegionDiskRequest { Region = "regionedb20d96", Resource = "resource164eab96", Project = "projectaa6ff846", - RegionSetPolicyRequestResource = new RegionSetPolicyRequest(), }; Policy expectedResponse = new Policy { @@ -1661,197 +448,127 @@ public void SetIamPolicy() Bindings = { new Binding(), }, IamOwned = false, }; - mockGrpcClient.Setup(x => x.SetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Policy responseCallSettings = await client.SetIamPolicyAsync(request.Project, request.Region, request.Resource, request.RegionSetPolicyRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Policy responseCallSettings = await client.GetIamPolicyAsync(request.Project, request.Region, request.Resource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Policy responseCancellationToken = await client.SetIamPolicyAsync(request.Project, request.Region, request.Resource, request.RegionSetPolicyRequestResource, st::CancellationToken.None); + Policy responseCancellationToken = await client.GetIamPolicyAsync(request.Project, request.Region, request.Resource, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void SetLabelsRequestObject() + public void SetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsRegionDiskRequest request = new SetLabelsRegionDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + SetIamPolicyRegionDiskRequest request = new SetIamPolicyRegionDiskRequest { - RequestId = "request_id362c8df6", Region = "regionedb20d96", Resource = "resource164eab96", Project = "projectaa6ff846", - RegionSetLabelsRequestResource = new RegionSetLabelsRequest(), + RegionSetPolicyRequestResource = new RegionSetPolicyRequest(), }; - Operation expectedResponse = new Operation + Policy expectedResponse = new Policy { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.SetLabels(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.SetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetLabels(request); + Policy response = client.SetIamPolicy(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task SetLabelsRequestObjectAsync() + public async stt::Task SetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsRegionDiskRequest request = new SetLabelsRegionDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + SetIamPolicyRegionDiskRequest request = new SetIamPolicyRegionDiskRequest { - RequestId = "request_id362c8df6", Region = "regionedb20d96", Resource = "resource164eab96", Project = "projectaa6ff846", - RegionSetLabelsRequestResource = new RegionSetLabelsRequest(), + RegionSetPolicyRequestResource = new RegionSetPolicyRequest(), }; - Operation expectedResponse = new Operation + Policy expectedResponse = new Policy { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.SetLabelsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.SetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetLabelsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Policy responseCallSettings = await client.SetIamPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetLabelsAsync(request, st::CancellationToken.None); + Policy responseCancellationToken = await client.SetIamPolicyAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void SetLabels() + public void SetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsRegionDiskRequest request = new SetLabelsRegionDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + SetIamPolicyRegionDiskRequest request = new SetIamPolicyRegionDiskRequest { Region = "regionedb20d96", Resource = "resource164eab96", Project = "projectaa6ff846", - RegionSetLabelsRequestResource = new RegionSetLabelsRequest(), + RegionSetPolicyRequestResource = new RegionSetPolicyRequest(), }; - Operation expectedResponse = new Operation + Policy expectedResponse = new Policy { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.SetLabels(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.SetIamPolicy(request, moq::It.IsAny())).Returns(expectedResponse); RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetLabels(request.Project, request.Region, request.Resource, request.RegionSetLabelsRequestResource); + Policy response = client.SetIamPolicy(request.Project, request.Region, request.Resource, request.RegionSetPolicyRequestResource); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task SetLabelsAsync() + public async stt::Task SetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsRegionDiskRequest request = new SetLabelsRegionDiskRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + SetIamPolicyRegionDiskRequest request = new SetIamPolicyRegionDiskRequest { Region = "regionedb20d96", Resource = "resource164eab96", Project = "projectaa6ff846", - RegionSetLabelsRequestResource = new RegionSetLabelsRequest(), + RegionSetPolicyRequestResource = new RegionSetPolicyRequest(), }; - Operation expectedResponse = new Operation + Policy expectedResponse = new Policy { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + Etag = "etage8ad7218", + Rules = { new Rule(), }, + AuditConfigs = { new AuditConfig(), }, + Version = 271578922, + Bindings = { new Binding(), }, + IamOwned = false, }; - mockGrpcClient.Setup(x => x.SetLabelsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.SetIamPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); RegionDisksClient client = new RegionDisksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetLabelsAsync(request.Project, request.Region, request.Resource, request.RegionSetLabelsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + Policy responseCallSettings = await client.SetIamPolicyAsync(request.Project, request.Region, request.Resource, request.RegionSetPolicyRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetLabelsAsync(request.Project, request.Region, request.Resource, request.RegionSetLabelsRequestResource, st::CancellationToken.None); + Policy responseCancellationToken = await client.SetIamPolicyAsync(request.Project, request.Region, request.Resource, request.RegionSetPolicyRequestResource, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } @@ -1860,6 +577,7 @@ public void SetLabels() public void TestIamPermissionsRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsRegionDiskRequest request = new TestIamPermissionsRegionDiskRequest { Region = "regionedb20d96", @@ -1885,6 +603,7 @@ public void TestIamPermissionsRequestObject() public async stt::Task TestIamPermissionsRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsRegionDiskRequest request = new TestIamPermissionsRegionDiskRequest { Region = "regionedb20d96", @@ -1912,6 +631,7 @@ public void TestIamPermissionsRequestObject() public void TestIamPermissions() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsRegionDiskRequest request = new TestIamPermissionsRegionDiskRequest { Region = "regionedb20d96", @@ -1937,6 +657,7 @@ public void TestIamPermissions() public async stt::Task TestIamPermissionsAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsRegionDiskRequest request = new TestIamPermissionsRegionDiskRequest { Region = "regionedb20d96", diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionHealthCheckServicesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionHealthCheckServicesClientTest.g.cs index ea9c32edd81e..f570eaa1a56c 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionHealthCheckServicesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionHealthCheckServicesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedRegionHealthCheckServicesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionHealthCheckServiceRequest request = new DeleteRegionHealthCheckServiceRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - HealthCheckService = "health_check_servicecdc3a03b", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionHealthCheckServicesClient client = new RegionHealthCheckServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionHealthCheckServiceRequest request = new DeleteRegionHealthCheckServiceRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - HealthCheckService = "health_check_servicecdc3a03b", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionHealthCheckServicesClient client = new RegionHealthCheckServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionHealthCheckServiceRequest request = new DeleteRegionHealthCheckServiceRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - HealthCheckService = "health_check_servicecdc3a03b", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionHealthCheckServicesClient client = new RegionHealthCheckServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.HealthCheckService); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionHealthCheckServiceRequest request = new DeleteRegionHealthCheckServiceRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - HealthCheckService = "health_check_servicecdc3a03b", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionHealthCheckServicesClient client = new RegionHealthCheckServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.HealthCheckService, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.HealthCheckService, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionHealthCheckServiceRequest request = new GetRegionHealthCheckServiceRequest { Region = "regionedb20d96", @@ -253,6 +73,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionHealthCheckServiceRequest request = new GetRegionHealthCheckServiceRequest { Region = "regionedb20d96", @@ -296,6 +117,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionHealthCheckServiceRequest request = new GetRegionHealthCheckServiceRequest { Region = "regionedb20d96", @@ -337,6 +159,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionHealthCheckServiceRequest request = new GetRegionHealthCheckServiceRequest { Region = "regionedb20d96", @@ -375,373 +198,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionHealthCheckServiceRequest request = new InsertRegionHealthCheckServiceRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - HealthCheckServiceResource = new HealthCheckService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionHealthCheckServicesClient client = new RegionHealthCheckServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionHealthCheckServiceRequest request = new InsertRegionHealthCheckServiceRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - HealthCheckServiceResource = new HealthCheckService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionHealthCheckServicesClient client = new RegionHealthCheckServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionHealthCheckServiceRequest request = new InsertRegionHealthCheckServiceRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - HealthCheckServiceResource = new HealthCheckService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionHealthCheckServicesClient client = new RegionHealthCheckServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.HealthCheckServiceResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionHealthCheckServiceRequest request = new InsertRegionHealthCheckServiceRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - HealthCheckServiceResource = new HealthCheckService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionHealthCheckServicesClient client = new RegionHealthCheckServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.HealthCheckServiceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.HealthCheckServiceResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionHealthCheckServiceRequest request = new PatchRegionHealthCheckServiceRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - HealthCheckService = "health_check_servicecdc3a03b", - HealthCheckServiceResource = new HealthCheckService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - RegionHealthCheckServicesClient client = new RegionHealthCheckServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionHealthCheckServiceRequest request = new PatchRegionHealthCheckServiceRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - HealthCheckService = "health_check_servicecdc3a03b", - HealthCheckServiceResource = new HealthCheckService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionHealthCheckServicesClient client = new RegionHealthCheckServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionHealthCheckServiceRequest request = new PatchRegionHealthCheckServiceRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - HealthCheckService = "health_check_servicecdc3a03b", - HealthCheckServiceResource = new HealthCheckService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - RegionHealthCheckServicesClient client = new RegionHealthCheckServicesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.Region, request.HealthCheckService, request.HealthCheckServiceResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionHealthCheckServiceRequest request = new PatchRegionHealthCheckServiceRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - HealthCheckService = "health_check_servicecdc3a03b", - HealthCheckServiceResource = new HealthCheckService(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionHealthCheckServicesClient client = new RegionHealthCheckServicesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.Region, request.HealthCheckService, request.HealthCheckServiceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.Region, request.HealthCheckService, request.HealthCheckServiceResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionHealthChecksClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionHealthChecksClientTest.g.cs index 7b87bc497e7c..9cf5f081235e 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionHealthChecksClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionHealthChecksClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedRegionHealthChecksClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionHealthCheckRequest request = new DeleteRegionHealthCheckRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionHealthChecksClient client = new RegionHealthChecksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionHealthCheckRequest request = new DeleteRegionHealthCheckRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionHealthChecksClient client = new RegionHealthChecksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionHealthCheckRequest request = new DeleteRegionHealthCheckRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionHealthChecksClient client = new RegionHealthChecksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.HealthCheck); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionHealthCheckRequest request = new DeleteRegionHealthCheckRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionHealthChecksClient client = new RegionHealthChecksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.HealthCheck, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.HealthCheck, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionHealthCheckRequest request = new GetRegionHealthCheckRequest { Region = "regionedb20d96", @@ -251,6 +71,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionHealthCheckRequest request = new GetRegionHealthCheckRequest { Region = "regionedb20d96", @@ -292,6 +113,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionHealthCheckRequest request = new GetRegionHealthCheckRequest { Region = "regionedb20d96", @@ -331,6 +153,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionHealthCheckRequest request = new GetRegionHealthCheckRequest { Region = "regionedb20d96", @@ -367,559 +190,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionHealthCheckRequest request = new InsertRegionHealthCheckRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionHealthChecksClient client = new RegionHealthChecksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionHealthCheckRequest request = new InsertRegionHealthCheckRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionHealthChecksClient client = new RegionHealthChecksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionHealthCheckRequest request = new InsertRegionHealthCheckRequest - { - Region = "regionedb20d96", - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionHealthChecksClient client = new RegionHealthChecksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.HealthCheckResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionHealthCheckRequest request = new InsertRegionHealthCheckRequest - { - Region = "regionedb20d96", - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionHealthChecksClient client = new RegionHealthChecksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.HealthCheckResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.HealthCheckResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionHealthCheckRequest request = new PatchRegionHealthCheckRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - RegionHealthChecksClient client = new RegionHealthChecksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionHealthCheckRequest request = new PatchRegionHealthCheckRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionHealthChecksClient client = new RegionHealthChecksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionHealthCheckRequest request = new PatchRegionHealthCheckRequest - { - Region = "regionedb20d96", - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - RegionHealthChecksClient client = new RegionHealthChecksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.Region, request.HealthCheck, request.HealthCheckResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionHealthCheckRequest request = new PatchRegionHealthCheckRequest - { - Region = "regionedb20d96", - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionHealthChecksClient client = new RegionHealthChecksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.Region, request.HealthCheck, request.HealthCheckResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.Region, request.HealthCheck, request.HealthCheckResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void UpdateRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateRegionHealthCheckRequest request = new UpdateRegionHealthCheckRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); - RegionHealthChecksClient client = new RegionHealthChecksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task UpdateRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateRegionHealthCheckRequest request = new UpdateRegionHealthCheckRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionHealthChecksClient client = new RegionHealthChecksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Update() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateRegionHealthCheckRequest request = new UpdateRegionHealthCheckRequest - { - Region = "regionedb20d96", - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); - RegionHealthChecksClient client = new RegionHealthChecksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request.Project, request.Region, request.HealthCheck, request.HealthCheckResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task UpdateAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateRegionHealthCheckRequest request = new UpdateRegionHealthCheckRequest - { - Region = "regionedb20d96", - HealthCheckResource = new HealthCheck(), - Project = "projectaa6ff846", - HealthCheck = "health_check13a16219", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionHealthChecksClient client = new RegionHealthChecksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request.Project, request.Region, request.HealthCheck, request.HealthCheckResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request.Project, request.Region, request.HealthCheck, request.HealthCheckResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionInstanceGroupManagersClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionInstanceGroupManagersClientTest.g.cs index f0da0a180bc9..58e49553d75f 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionInstanceGroupManagersClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionInstanceGroupManagersClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -27,2801 +28,213 @@ namespace Google.Cloud.Compute.V1.Tests public sealed class GeneratedRegionInstanceGroupManagersClientTest { [xunit::FactAttribute] - public void AbandonInstancesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AbandonInstancesRegionInstanceGroupManagerRequest request = new AbandonInstancesRegionInstanceGroupManagerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - RegionInstanceGroupManagersAbandonInstancesRequestResource = new RegionInstanceGroupManagersAbandonInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AbandonInstances(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.AbandonInstances(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AbandonInstancesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AbandonInstancesRegionInstanceGroupManagerRequest request = new AbandonInstancesRegionInstanceGroupManagerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - RegionInstanceGroupManagersAbandonInstancesRequestResource = new RegionInstanceGroupManagersAbandonInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AbandonInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AbandonInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AbandonInstancesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void AbandonInstances() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AbandonInstancesRegionInstanceGroupManagerRequest request = new AbandonInstancesRegionInstanceGroupManagerRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - RegionInstanceGroupManagersAbandonInstancesRequestResource = new RegionInstanceGroupManagersAbandonInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AbandonInstances(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.AbandonInstances(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagersAbandonInstancesRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AbandonInstancesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AbandonInstancesRegionInstanceGroupManagerRequest request = new AbandonInstancesRegionInstanceGroupManagerRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - RegionInstanceGroupManagersAbandonInstancesRequestResource = new RegionInstanceGroupManagersAbandonInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AbandonInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AbandonInstancesAsync(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagersAbandonInstancesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AbandonInstancesAsync(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagersAbandonInstancesRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void ApplyUpdatesToInstancesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest request = new ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest - { - RegionInstanceGroupManagersApplyUpdatesRequestResource = new RegionInstanceGroupManagersApplyUpdatesRequest(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.ApplyUpdatesToInstances(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.ApplyUpdatesToInstances(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task ApplyUpdatesToInstancesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest request = new ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest - { - RegionInstanceGroupManagersApplyUpdatesRequestResource = new RegionInstanceGroupManagersApplyUpdatesRequest(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.ApplyUpdatesToInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.ApplyUpdatesToInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.ApplyUpdatesToInstancesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void ApplyUpdatesToInstances() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest request = new ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest - { - RegionInstanceGroupManagersApplyUpdatesRequestResource = new RegionInstanceGroupManagersApplyUpdatesRequest(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.ApplyUpdatesToInstances(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.ApplyUpdatesToInstances(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagersApplyUpdatesRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task ApplyUpdatesToInstancesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest request = new ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest - { - RegionInstanceGroupManagersApplyUpdatesRequestResource = new RegionInstanceGroupManagersApplyUpdatesRequest(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.ApplyUpdatesToInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.ApplyUpdatesToInstancesAsync(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagersApplyUpdatesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.ApplyUpdatesToInstancesAsync(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagersApplyUpdatesRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void CreateInstancesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - CreateInstancesRegionInstanceGroupManagerRequest request = new CreateInstancesRegionInstanceGroupManagerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - RegionInstanceGroupManagersCreateInstancesRequestResource = new RegionInstanceGroupManagersCreateInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.CreateInstances(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.CreateInstances(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task CreateInstancesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - CreateInstancesRegionInstanceGroupManagerRequest request = new CreateInstancesRegionInstanceGroupManagerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - RegionInstanceGroupManagersCreateInstancesRequestResource = new RegionInstanceGroupManagersCreateInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.CreateInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.CreateInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.CreateInstancesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void CreateInstances() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - CreateInstancesRegionInstanceGroupManagerRequest request = new CreateInstancesRegionInstanceGroupManagerRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - RegionInstanceGroupManagersCreateInstancesRequestResource = new RegionInstanceGroupManagersCreateInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.CreateInstances(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.CreateInstances(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagersCreateInstancesRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task CreateInstancesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - CreateInstancesRegionInstanceGroupManagerRequest request = new CreateInstancesRegionInstanceGroupManagerRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - RegionInstanceGroupManagersCreateInstancesRequestResource = new RegionInstanceGroupManagersCreateInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.CreateInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.CreateInstancesAsync(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagersCreateInstancesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.CreateInstancesAsync(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagersCreateInstancesRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionInstanceGroupManagerRequest request = new DeleteRegionInstanceGroupManagerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionInstanceGroupManagerRequest request = new DeleteRegionInstanceGroupManagerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionInstanceGroupManagerRequest request = new DeleteRegionInstanceGroupManagerRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.InstanceGroupManager); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionInstanceGroupManagerRequest request = new DeleteRegionInstanceGroupManagerRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.InstanceGroupManager, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.InstanceGroupManager, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteInstancesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstancesRegionInstanceGroupManagerRequest request = new DeleteInstancesRegionInstanceGroupManagerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - RegionInstanceGroupManagersDeleteInstancesRequestResource = new RegionInstanceGroupManagersDeleteInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteInstances(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.DeleteInstances(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteInstancesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstancesRegionInstanceGroupManagerRequest request = new DeleteInstancesRegionInstanceGroupManagerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - RegionInstanceGroupManagersDeleteInstancesRequestResource = new RegionInstanceGroupManagersDeleteInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteInstancesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteInstances() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstancesRegionInstanceGroupManagerRequest request = new DeleteInstancesRegionInstanceGroupManagerRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - RegionInstanceGroupManagersDeleteInstancesRequestResource = new RegionInstanceGroupManagersDeleteInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteInstances(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.DeleteInstances(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagersDeleteInstancesRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteInstancesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteInstancesRegionInstanceGroupManagerRequest request = new DeleteInstancesRegionInstanceGroupManagerRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - RegionInstanceGroupManagersDeleteInstancesRequestResource = new RegionInstanceGroupManagersDeleteInstancesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteInstancesAsync(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagersDeleteInstancesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteInstancesAsync(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagersDeleteInstancesRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeletePerInstanceConfigsRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeletePerInstanceConfigsRegionInstanceGroupManagerRequest request = new DeletePerInstanceConfigsRegionInstanceGroupManagerRequest - { - RegionInstanceGroupManagerDeleteInstanceConfigReqResource = new RegionInstanceGroupManagerDeleteInstanceConfigReq(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeletePerInstanceConfigs(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.DeletePerInstanceConfigs(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeletePerInstanceConfigsRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeletePerInstanceConfigsRegionInstanceGroupManagerRequest request = new DeletePerInstanceConfigsRegionInstanceGroupManagerRequest - { - RegionInstanceGroupManagerDeleteInstanceConfigReqResource = new RegionInstanceGroupManagerDeleteInstanceConfigReq(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeletePerInstanceConfigsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeletePerInstanceConfigsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeletePerInstanceConfigsAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeletePerInstanceConfigs() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeletePerInstanceConfigsRegionInstanceGroupManagerRequest request = new DeletePerInstanceConfigsRegionInstanceGroupManagerRequest - { - RegionInstanceGroupManagerDeleteInstanceConfigReqResource = new RegionInstanceGroupManagerDeleteInstanceConfigReq(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeletePerInstanceConfigs(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.DeletePerInstanceConfigs(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagerDeleteInstanceConfigReqResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeletePerInstanceConfigsAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeletePerInstanceConfigsRegionInstanceGroupManagerRequest request = new DeletePerInstanceConfigsRegionInstanceGroupManagerRequest - { - RegionInstanceGroupManagerDeleteInstanceConfigReqResource = new RegionInstanceGroupManagerDeleteInstanceConfigReq(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeletePerInstanceConfigsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeletePerInstanceConfigsAsync(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagerDeleteInstanceConfigReqResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeletePerInstanceConfigsAsync(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagerDeleteInstanceConfigReqResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetRegionInstanceGroupManagerRequest request = new GetRegionInstanceGroupManagerRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - InstanceGroupManager expectedResponse = new InstanceGroupManager - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StatefulPolicy = new StatefulPolicy(), - TargetSize = -93132225, - InstanceGroup = "instance_group6bf5a5ef", - Region = "regionedb20d96", - Versions = - { - new InstanceGroupManagerVersion(), - }, - CurrentActions = new InstanceGroupManagerActionsSummary(), - UpdatePolicy = new InstanceGroupManagerUpdatePolicy(), - Status = new InstanceGroupManagerStatus(), - Fingerprint = "fingerprint009e6052", - InstanceTemplate = "instance_template6cae3083", - TargetPools = - { - "target_pools6fc69e1f", - }, - BaseInstanceName = "base_instance_name7c1f304c", - Description = "description2cf9da67", - NamedPorts = { new NamedPort(), }, - SelfLink = "self_link7e87f12d", - AutoHealingPolicies = - { - new InstanceGroupManagerAutoHealingPolicy(), - }, - DistributionPolicy = new DistributionPolicy(), - }; - mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - InstanceGroupManager response = client.Get(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetRegionInstanceGroupManagerRequest request = new GetRegionInstanceGroupManagerRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - InstanceGroupManager expectedResponse = new InstanceGroupManager - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StatefulPolicy = new StatefulPolicy(), - TargetSize = -93132225, - InstanceGroup = "instance_group6bf5a5ef", - Region = "regionedb20d96", - Versions = - { - new InstanceGroupManagerVersion(), - }, - CurrentActions = new InstanceGroupManagerActionsSummary(), - UpdatePolicy = new InstanceGroupManagerUpdatePolicy(), - Status = new InstanceGroupManagerStatus(), - Fingerprint = "fingerprint009e6052", - InstanceTemplate = "instance_template6cae3083", - TargetPools = - { - "target_pools6fc69e1f", - }, - BaseInstanceName = "base_instance_name7c1f304c", - Description = "description2cf9da67", - NamedPorts = { new NamedPort(), }, - SelfLink = "self_link7e87f12d", - AutoHealingPolicies = - { - new InstanceGroupManagerAutoHealingPolicy(), - }, - DistributionPolicy = new DistributionPolicy(), - }; - mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - InstanceGroupManager responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - InstanceGroupManager responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Get() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetRegionInstanceGroupManagerRequest request = new GetRegionInstanceGroupManagerRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - InstanceGroupManager expectedResponse = new InstanceGroupManager - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StatefulPolicy = new StatefulPolicy(), - TargetSize = -93132225, - InstanceGroup = "instance_group6bf5a5ef", - Region = "regionedb20d96", - Versions = - { - new InstanceGroupManagerVersion(), - }, - CurrentActions = new InstanceGroupManagerActionsSummary(), - UpdatePolicy = new InstanceGroupManagerUpdatePolicy(), - Status = new InstanceGroupManagerStatus(), - Fingerprint = "fingerprint009e6052", - InstanceTemplate = "instance_template6cae3083", - TargetPools = - { - "target_pools6fc69e1f", - }, - BaseInstanceName = "base_instance_name7c1f304c", - Description = "description2cf9da67", - NamedPorts = { new NamedPort(), }, - SelfLink = "self_link7e87f12d", - AutoHealingPolicies = - { - new InstanceGroupManagerAutoHealingPolicy(), - }, - DistributionPolicy = new DistributionPolicy(), - }; - mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - InstanceGroupManager response = client.Get(request.Project, request.Region, request.InstanceGroupManager); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetRegionInstanceGroupManagerRequest request = new GetRegionInstanceGroupManagerRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - InstanceGroupManager expectedResponse = new InstanceGroupManager - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StatefulPolicy = new StatefulPolicy(), - TargetSize = -93132225, - InstanceGroup = "instance_group6bf5a5ef", - Region = "regionedb20d96", - Versions = - { - new InstanceGroupManagerVersion(), - }, - CurrentActions = new InstanceGroupManagerActionsSummary(), - UpdatePolicy = new InstanceGroupManagerUpdatePolicy(), - Status = new InstanceGroupManagerStatus(), - Fingerprint = "fingerprint009e6052", - InstanceTemplate = "instance_template6cae3083", - TargetPools = - { - "target_pools6fc69e1f", - }, - BaseInstanceName = "base_instance_name7c1f304c", - Description = "description2cf9da67", - NamedPorts = { new NamedPort(), }, - SelfLink = "self_link7e87f12d", - AutoHealingPolicies = - { - new InstanceGroupManagerAutoHealingPolicy(), - }, - DistributionPolicy = new DistributionPolicy(), - }; - mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - InstanceGroupManager responseCallSettings = await client.GetAsync(request.Project, request.Region, request.InstanceGroupManager, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - InstanceGroupManager responseCancellationToken = await client.GetAsync(request.Project, request.Region, request.InstanceGroupManager, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionInstanceGroupManagerRequest request = new InsertRegionInstanceGroupManagerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManagerResource = new InstanceGroupManager(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionInstanceGroupManagerRequest request = new InsertRegionInstanceGroupManagerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManagerResource = new InstanceGroupManager(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionInstanceGroupManagerRequest request = new InsertRegionInstanceGroupManagerRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManagerResource = new InstanceGroupManager(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.InstanceGroupManagerResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionInstanceGroupManagerRequest request = new InsertRegionInstanceGroupManagerRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManagerResource = new InstanceGroupManager(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.InstanceGroupManagerResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.InstanceGroupManagerResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionInstanceGroupManagerRequest request = new PatchRegionInstanceGroupManagerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagerResource = new InstanceGroupManager(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionInstanceGroupManagerRequest request = new PatchRegionInstanceGroupManagerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagerResource = new InstanceGroupManager(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionInstanceGroupManagerRequest request = new PatchRegionInstanceGroupManagerRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagerResource = new InstanceGroupManager(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.Region, request.InstanceGroupManager, request.InstanceGroupManagerResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionInstanceGroupManagerRequest request = new PatchRegionInstanceGroupManagerRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - InstanceGroupManagerResource = new InstanceGroupManager(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.Region, request.InstanceGroupManager, request.InstanceGroupManagerResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.Region, request.InstanceGroupManager, request.InstanceGroupManagerResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchPerInstanceConfigsRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchPerInstanceConfigsRegionInstanceGroupManagerRequest request = new PatchPerInstanceConfigsRegionInstanceGroupManagerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - RegionInstanceGroupManagerPatchInstanceConfigReqResource = new RegionInstanceGroupManagerPatchInstanceConfigReq(), - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchPerInstanceConfigs(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.PatchPerInstanceConfigs(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchPerInstanceConfigsRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchPerInstanceConfigsRegionInstanceGroupManagerRequest request = new PatchPerInstanceConfigsRegionInstanceGroupManagerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - RegionInstanceGroupManagerPatchInstanceConfigReqResource = new RegionInstanceGroupManagerPatchInstanceConfigReq(), - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchPerInstanceConfigsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchPerInstanceConfigsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchPerInstanceConfigsAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchPerInstanceConfigs() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchPerInstanceConfigsRegionInstanceGroupManagerRequest request = new PatchPerInstanceConfigsRegionInstanceGroupManagerRequest - { - Region = "regionedb20d96", - RegionInstanceGroupManagerPatchInstanceConfigReqResource = new RegionInstanceGroupManagerPatchInstanceConfigReq(), - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchPerInstanceConfigs(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.PatchPerInstanceConfigs(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagerPatchInstanceConfigReqResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchPerInstanceConfigsAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchPerInstanceConfigsRegionInstanceGroupManagerRequest request = new PatchPerInstanceConfigsRegionInstanceGroupManagerRequest - { - Region = "regionedb20d96", - RegionInstanceGroupManagerPatchInstanceConfigReqResource = new RegionInstanceGroupManagerPatchInstanceConfigReq(), - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchPerInstanceConfigsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchPerInstanceConfigsAsync(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagerPatchInstanceConfigReqResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchPerInstanceConfigsAsync(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagerPatchInstanceConfigReqResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void RecreateInstancesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RecreateInstancesRegionInstanceGroupManagerRequest request = new RecreateInstancesRegionInstanceGroupManagerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - RegionInstanceGroupManagersRecreateRequestResource = new RegionInstanceGroupManagersRecreateRequest(), - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RecreateInstances(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.RecreateInstances(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task RecreateInstancesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RecreateInstancesRegionInstanceGroupManagerRequest request = new RecreateInstancesRegionInstanceGroupManagerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - RegionInstanceGroupManagersRecreateRequestResource = new RegionInstanceGroupManagersRecreateRequest(), - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RecreateInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RecreateInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RecreateInstancesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void RecreateInstances() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RecreateInstancesRegionInstanceGroupManagerRequest request = new RecreateInstancesRegionInstanceGroupManagerRequest - { - Region = "regionedb20d96", - RegionInstanceGroupManagersRecreateRequestResource = new RegionInstanceGroupManagersRecreateRequest(), - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RecreateInstances(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.RecreateInstances(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagersRecreateRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task RecreateInstancesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RecreateInstancesRegionInstanceGroupManagerRequest request = new RecreateInstancesRegionInstanceGroupManagerRequest - { - Region = "regionedb20d96", - RegionInstanceGroupManagersRecreateRequestResource = new RegionInstanceGroupManagersRecreateRequest(), - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RecreateInstancesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RecreateInstancesAsync(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagersRecreateRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RecreateInstancesAsync(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagersRecreateRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void ResizeRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResizeRegionInstanceGroupManagerRequest request = new ResizeRegionInstanceGroupManagerRequest - { - Size = -1218396681, - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Resize(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Resize(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task ResizeRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResizeRegionInstanceGroupManagerRequest request = new ResizeRegionInstanceGroupManagerRequest - { - Size = -1218396681, - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.ResizeAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.ResizeAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.ResizeAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Resize() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResizeRegionInstanceGroupManagerRequest request = new ResizeRegionInstanceGroupManagerRequest - { - Size = -1218396681, - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Resize(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Resize(request.Project, request.Region, request.InstanceGroupManager, request.Size); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task ResizeAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResizeRegionInstanceGroupManagerRequest request = new ResizeRegionInstanceGroupManagerRequest - { - Size = -1218396681, - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.ResizeAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.ResizeAsync(request.Project, request.Region, request.InstanceGroupManager, request.Size, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.ResizeAsync(request.Project, request.Region, request.InstanceGroupManager, request.Size, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetInstanceTemplateRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetInstanceTemplateRegionInstanceGroupManagerRequest request = new SetInstanceTemplateRegionInstanceGroupManagerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - RegionInstanceGroupManagersSetTemplateRequestResource = new RegionInstanceGroupManagersSetTemplateRequest(), - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetInstanceTemplate(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetInstanceTemplate(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetInstanceTemplateRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetInstanceTemplateRegionInstanceGroupManagerRequest request = new SetInstanceTemplateRegionInstanceGroupManagerRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - RegionInstanceGroupManagersSetTemplateRequestResource = new RegionInstanceGroupManagersSetTemplateRequest(), - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetInstanceTemplateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetInstanceTemplateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetInstanceTemplateAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetInstanceTemplate() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetInstanceTemplateRegionInstanceGroupManagerRequest request = new SetInstanceTemplateRegionInstanceGroupManagerRequest - { - Region = "regionedb20d96", - RegionInstanceGroupManagersSetTemplateRequestResource = new RegionInstanceGroupManagersSetTemplateRequest(), - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetInstanceTemplate(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetInstanceTemplate(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagersSetTemplateRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetInstanceTemplateAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetInstanceTemplateRegionInstanceGroupManagerRequest request = new SetInstanceTemplateRegionInstanceGroupManagerRequest - { - Region = "regionedb20d96", - RegionInstanceGroupManagersSetTemplateRequestResource = new RegionInstanceGroupManagersSetTemplateRequest(), - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetInstanceTemplateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetInstanceTemplateAsync(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagersSetTemplateRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetInstanceTemplateAsync(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagersSetTemplateRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetTargetPoolsRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetTargetPoolsRegionInstanceGroupManagerRequest request = new SetTargetPoolsRegionInstanceGroupManagerRequest - { - RequestId = "request_id362c8df6", - RegionInstanceGroupManagersSetTargetPoolsRequestResource = new RegionInstanceGroupManagersSetTargetPoolsRequest(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetTargetPools(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetTargetPools(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetTargetPoolsRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetTargetPoolsRegionInstanceGroupManagerRequest request = new SetTargetPoolsRegionInstanceGroupManagerRequest - { - RequestId = "request_id362c8df6", - RegionInstanceGroupManagersSetTargetPoolsRequestResource = new RegionInstanceGroupManagersSetTargetPoolsRequest(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetTargetPoolsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetTargetPoolsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetTargetPoolsAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetTargetPools() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetTargetPoolsRegionInstanceGroupManagerRequest request = new SetTargetPoolsRegionInstanceGroupManagerRequest - { - RegionInstanceGroupManagersSetTargetPoolsRequestResource = new RegionInstanceGroupManagersSetTargetPoolsRequest(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetTargetPools(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetTargetPools(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagersSetTargetPoolsRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetTargetPoolsAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetTargetPoolsRegionInstanceGroupManagerRequest request = new SetTargetPoolsRegionInstanceGroupManagerRequest - { - RegionInstanceGroupManagersSetTargetPoolsRequestResource = new RegionInstanceGroupManagersSetTargetPoolsRequest(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceGroupManager = "instance_group_manager71b45dfc", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetTargetPoolsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetTargetPoolsAsync(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagersSetTargetPoolsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetTargetPoolsAsync(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagersSetTargetPoolsRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void UpdatePerInstanceConfigsRequestObject() + public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest request = new UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + GetRegionInstanceGroupManagerRequest request = new GetRegionInstanceGroupManagerRequest { - RequestId = "request_id362c8df6", - RegionInstanceGroupManagerUpdateInstanceConfigReqResource = new RegionInstanceGroupManagerUpdateInstanceConfigReq(), Region = "regionedb20d96", Project = "projectaa6ff846", InstanceGroupManager = "instance_group_manager71b45dfc", }; - Operation expectedResponse = new Operation + InstanceGroupManager expectedResponse = new InstanceGroupManager { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", Zone = "zone255f4ea8", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + StatefulPolicy = new StatefulPolicy(), + TargetSize = -93132225, + InstanceGroup = "instance_group6bf5a5ef", Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Versions = + { + new InstanceGroupManagerVersion(), + }, + CurrentActions = new InstanceGroupManagerActionsSummary(), + UpdatePolicy = new InstanceGroupManagerUpdatePolicy(), + Status = new InstanceGroupManagerStatus(), + Fingerprint = "fingerprint009e6052", + InstanceTemplate = "instance_template6cae3083", + TargetPools = + { + "target_pools6fc69e1f", + }, + BaseInstanceName = "base_instance_name7c1f304c", Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + NamedPorts = { new NamedPort(), }, SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + AutoHealingPolicies = + { + new InstanceGroupManagerAutoHealingPolicy(), + }, + DistributionPolicy = new DistributionPolicy(), }; - mockGrpcClient.Setup(x => x.UpdatePerInstanceConfigs(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.UpdatePerInstanceConfigs(request); + InstanceGroupManager response = client.Get(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task UpdatePerInstanceConfigsRequestObjectAsync() + public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest request = new UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + GetRegionInstanceGroupManagerRequest request = new GetRegionInstanceGroupManagerRequest { - RequestId = "request_id362c8df6", - RegionInstanceGroupManagerUpdateInstanceConfigReqResource = new RegionInstanceGroupManagerUpdateInstanceConfigReq(), Region = "regionedb20d96", Project = "projectaa6ff846", InstanceGroupManager = "instance_group_manager71b45dfc", }; - Operation expectedResponse = new Operation + InstanceGroupManager expectedResponse = new InstanceGroupManager { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", Zone = "zone255f4ea8", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + StatefulPolicy = new StatefulPolicy(), + TargetSize = -93132225, + InstanceGroup = "instance_group6bf5a5ef", Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Versions = + { + new InstanceGroupManagerVersion(), + }, + CurrentActions = new InstanceGroupManagerActionsSummary(), + UpdatePolicy = new InstanceGroupManagerUpdatePolicy(), + Status = new InstanceGroupManagerStatus(), + Fingerprint = "fingerprint009e6052", + InstanceTemplate = "instance_template6cae3083", + TargetPools = + { + "target_pools6fc69e1f", + }, + BaseInstanceName = "base_instance_name7c1f304c", Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + NamedPorts = { new NamedPort(), }, SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + AutoHealingPolicies = + { + new InstanceGroupManagerAutoHealingPolicy(), + }, + DistributionPolicy = new DistributionPolicy(), }; - mockGrpcClient.Setup(x => x.UpdatePerInstanceConfigsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdatePerInstanceConfigsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + InstanceGroupManager responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdatePerInstanceConfigsAsync(request, st::CancellationToken.None); + InstanceGroupManager responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void UpdatePerInstanceConfigs() + public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest request = new UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + GetRegionInstanceGroupManagerRequest request = new GetRegionInstanceGroupManagerRequest { - RegionInstanceGroupManagerUpdateInstanceConfigReqResource = new RegionInstanceGroupManagerUpdateInstanceConfigReq(), Region = "regionedb20d96", Project = "projectaa6ff846", InstanceGroupManager = "instance_group_manager71b45dfc", }; - Operation expectedResponse = new Operation + InstanceGroupManager expectedResponse = new InstanceGroupManager { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", Zone = "zone255f4ea8", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + StatefulPolicy = new StatefulPolicy(), + TargetSize = -93132225, + InstanceGroup = "instance_group6bf5a5ef", Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Versions = + { + new InstanceGroupManagerVersion(), + }, + CurrentActions = new InstanceGroupManagerActionsSummary(), + UpdatePolicy = new InstanceGroupManagerUpdatePolicy(), + Status = new InstanceGroupManagerStatus(), + Fingerprint = "fingerprint009e6052", + InstanceTemplate = "instance_template6cae3083", + TargetPools = + { + "target_pools6fc69e1f", + }, + BaseInstanceName = "base_instance_name7c1f304c", Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + NamedPorts = { new NamedPort(), }, SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + AutoHealingPolicies = + { + new InstanceGroupManagerAutoHealingPolicy(), + }, + DistributionPolicy = new DistributionPolicy(), }; - mockGrpcClient.Setup(x => x.UpdatePerInstanceConfigs(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation response = client.UpdatePerInstanceConfigs(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagerUpdateInstanceConfigReqResource); + InstanceGroupManager response = client.Get(request.Project, request.Region, request.InstanceGroupManager); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task UpdatePerInstanceConfigsAsync() + public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest request = new UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + GetRegionInstanceGroupManagerRequest request = new GetRegionInstanceGroupManagerRequest { - RegionInstanceGroupManagerUpdateInstanceConfigReqResource = new RegionInstanceGroupManagerUpdateInstanceConfigReq(), Region = "regionedb20d96", Project = "projectaa6ff846", InstanceGroupManager = "instance_group_manager71b45dfc", }; - Operation expectedResponse = new Operation + InstanceGroupManager expectedResponse = new InstanceGroupManager { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", Zone = "zone255f4ea8", CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + StatefulPolicy = new StatefulPolicy(), + TargetSize = -93132225, + InstanceGroup = "instance_group6bf5a5ef", Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + Versions = + { + new InstanceGroupManagerVersion(), + }, + CurrentActions = new InstanceGroupManagerActionsSummary(), + UpdatePolicy = new InstanceGroupManagerUpdatePolicy(), + Status = new InstanceGroupManagerStatus(), + Fingerprint = "fingerprint009e6052", + InstanceTemplate = "instance_template6cae3083", + TargetPools = + { + "target_pools6fc69e1f", + }, + BaseInstanceName = "base_instance_name7c1f304c", Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + NamedPorts = { new NamedPort(), }, SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + AutoHealingPolicies = + { + new InstanceGroupManagerAutoHealingPolicy(), + }, + DistributionPolicy = new DistributionPolicy(), }; - mockGrpcClient.Setup(x => x.UpdatePerInstanceConfigsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); RegionInstanceGroupManagersClient client = new RegionInstanceGroupManagersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdatePerInstanceConfigsAsync(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagerUpdateInstanceConfigReqResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + InstanceGroupManager responseCallSettings = await client.GetAsync(request.Project, request.Region, request.InstanceGroupManager, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdatePerInstanceConfigsAsync(request.Project, request.Region, request.InstanceGroupManager, request.RegionInstanceGroupManagerUpdateInstanceConfigReqResource, st::CancellationToken.None); + InstanceGroupManager responseCancellationToken = await client.GetAsync(request.Project, request.Region, request.InstanceGroupManager, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionInstanceGroupsClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionInstanceGroupsClientTest.g.cs index a62832004fc9..f5bd26583b00 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionInstanceGroupsClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionInstanceGroupsClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -30,6 +31,7 @@ public sealed class GeneratedRegionInstanceGroupsClientTest public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionInstanceGroupRequest request = new GetRegionInstanceGroupRequest { InstanceGroup = "instance_group6bf5a5ef", @@ -63,6 +65,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionInstanceGroupRequest request = new GetRegionInstanceGroupRequest { InstanceGroup = "instance_group6bf5a5ef", @@ -98,6 +101,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionInstanceGroupRequest request = new GetRegionInstanceGroupRequest { InstanceGroup = "instance_group6bf5a5ef", @@ -131,6 +135,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionInstanceGroupRequest request = new GetRegionInstanceGroupRequest { InstanceGroup = "instance_group6bf5a5ef", @@ -161,191 +166,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void SetNamedPortsRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetNamedPortsRegionInstanceGroupRequest request = new SetNamedPortsRegionInstanceGroupRequest - { - RegionInstanceGroupsSetNamedPortsRequestResource = new RegionInstanceGroupsSetNamedPortsRequest(), - RequestId = "request_id362c8df6", - InstanceGroup = "instance_group6bf5a5ef", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetNamedPorts(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupsClient client = new RegionInstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetNamedPorts(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetNamedPortsRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetNamedPortsRegionInstanceGroupRequest request = new SetNamedPortsRegionInstanceGroupRequest - { - RegionInstanceGroupsSetNamedPortsRequestResource = new RegionInstanceGroupsSetNamedPortsRequest(), - RequestId = "request_id362c8df6", - InstanceGroup = "instance_group6bf5a5ef", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetNamedPortsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupsClient client = new RegionInstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetNamedPortsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetNamedPortsAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetNamedPorts() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetNamedPortsRegionInstanceGroupRequest request = new SetNamedPortsRegionInstanceGroupRequest - { - RegionInstanceGroupsSetNamedPortsRequestResource = new RegionInstanceGroupsSetNamedPortsRequest(), - InstanceGroup = "instance_group6bf5a5ef", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetNamedPorts(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstanceGroupsClient client = new RegionInstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetNamedPorts(request.Project, request.Region, request.InstanceGroup, request.RegionInstanceGroupsSetNamedPortsRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetNamedPortsAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetNamedPortsRegionInstanceGroupRequest request = new SetNamedPortsRegionInstanceGroupRequest - { - RegionInstanceGroupsSetNamedPortsRequestResource = new RegionInstanceGroupsSetNamedPortsRequest(), - InstanceGroup = "instance_group6bf5a5ef", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetNamedPortsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstanceGroupsClient client = new RegionInstanceGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetNamedPortsAsync(request.Project, request.Region, request.InstanceGroup, request.RegionInstanceGroupsSetNamedPortsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetNamedPortsAsync(request.Project, request.Region, request.InstanceGroup, request.RegionInstanceGroupsSetNamedPortsRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionInstancesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionInstancesClientTest.g.cs index bb9bc8b0f1d1..9631287c8e07 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionInstancesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionInstancesClientTest.g.cs @@ -14,198 +14,10 @@ // Generated code. DO NOT EDIT! -using gaxgrpc = Google.Api.Gax.Grpc; -using grpccore = Grpc.Core; -using moq = Moq; -using st = System.Threading; -using stt = System.Threading.Tasks; -using xunit = Xunit; - namespace Google.Cloud.Compute.V1.Tests { /// Generated unit tests. public sealed class GeneratedRegionInstancesClientTest { - [xunit::FactAttribute] - public void BulkInsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - BulkInsertRegionInstanceRequest request = new BulkInsertRegionInstanceRequest - { - RequestId = "request_id362c8df6", - BulkInsertInstanceResourceResource = new BulkInsertInstanceResource(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.BulkInsert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstancesClient client = new RegionInstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.BulkInsert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task BulkInsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - BulkInsertRegionInstanceRequest request = new BulkInsertRegionInstanceRequest - { - RequestId = "request_id362c8df6", - BulkInsertInstanceResourceResource = new BulkInsertInstanceResource(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.BulkInsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstancesClient client = new RegionInstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.BulkInsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.BulkInsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void BulkInsert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - BulkInsertRegionInstanceRequest request = new BulkInsertRegionInstanceRequest - { - BulkInsertInstanceResourceResource = new BulkInsertInstanceResource(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.BulkInsert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionInstancesClient client = new RegionInstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.BulkInsert(request.Project, request.Region, request.BulkInsertInstanceResourceResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task BulkInsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - BulkInsertRegionInstanceRequest request = new BulkInsertRegionInstanceRequest - { - BulkInsertInstanceResourceResource = new BulkInsertInstanceResource(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.BulkInsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionInstancesClient client = new RegionInstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.BulkInsertAsync(request.Project, request.Region, request.BulkInsertInstanceResourceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.BulkInsertAsync(request.Project, request.Region, request.BulkInsertInstanceResourceResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionNetworkEndpointGroupsClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionNetworkEndpointGroupsClientTest.g.cs index 768753785132..c2ddd8f6709e 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionNetworkEndpointGroupsClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionNetworkEndpointGroupsClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedRegionNetworkEndpointGroupsClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionNetworkEndpointGroupRequest request = new DeleteRegionNetworkEndpointGroupRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionNetworkEndpointGroupsClient client = new RegionNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionNetworkEndpointGroupRequest request = new DeleteRegionNetworkEndpointGroupRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionNetworkEndpointGroupsClient client = new RegionNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionNetworkEndpointGroupRequest request = new DeleteRegionNetworkEndpointGroupRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionNetworkEndpointGroupsClient client = new RegionNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.NetworkEndpointGroup); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionNetworkEndpointGroupRequest request = new DeleteRegionNetworkEndpointGroupRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - NetworkEndpointGroup = "network_endpoint_groupdf1fb34e", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionNetworkEndpointGroupsClient client = new RegionNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.NetworkEndpointGroup, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.NetworkEndpointGroup, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionNetworkEndpointGroupRequest request = new GetRegionNetworkEndpointGroupRequest { Region = "regionedb20d96", @@ -255,6 +75,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionNetworkEndpointGroupRequest request = new GetRegionNetworkEndpointGroupRequest { Region = "regionedb20d96", @@ -300,6 +121,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionNetworkEndpointGroupRequest request = new GetRegionNetworkEndpointGroupRequest { Region = "regionedb20d96", @@ -343,6 +165,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionNetworkEndpointGroupRequest request = new GetRegionNetworkEndpointGroupRequest { Region = "regionedb20d96", @@ -383,187 +206,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionNetworkEndpointGroupRequest request = new InsertRegionNetworkEndpointGroupRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - NetworkEndpointGroupResource = new NetworkEndpointGroup(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionNetworkEndpointGroupsClient client = new RegionNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionNetworkEndpointGroupRequest request = new InsertRegionNetworkEndpointGroupRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - NetworkEndpointGroupResource = new NetworkEndpointGroup(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionNetworkEndpointGroupsClient client = new RegionNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionNetworkEndpointGroupRequest request = new InsertRegionNetworkEndpointGroupRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - NetworkEndpointGroupResource = new NetworkEndpointGroup(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionNetworkEndpointGroupsClient client = new RegionNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.NetworkEndpointGroupResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionNetworkEndpointGroupRequest request = new InsertRegionNetworkEndpointGroupRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - NetworkEndpointGroupResource = new NetworkEndpointGroup(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionNetworkEndpointGroupsClient client = new RegionNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.NetworkEndpointGroupResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.NetworkEndpointGroupResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionNotificationEndpointsClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionNotificationEndpointsClientTest.g.cs index d1b232339f4c..549e3db40b9c 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionNotificationEndpointsClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionNotificationEndpointsClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedRegionNotificationEndpointsClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionNotificationEndpointRequest request = new DeleteRegionNotificationEndpointRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - NotificationEndpoint = "notification_endpointbe78db22", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionNotificationEndpointsClient client = new RegionNotificationEndpointsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionNotificationEndpointRequest request = new DeleteRegionNotificationEndpointRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - NotificationEndpoint = "notification_endpointbe78db22", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionNotificationEndpointsClient client = new RegionNotificationEndpointsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionNotificationEndpointRequest request = new DeleteRegionNotificationEndpointRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - NotificationEndpoint = "notification_endpointbe78db22", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionNotificationEndpointsClient client = new RegionNotificationEndpointsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.NotificationEndpoint); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionNotificationEndpointRequest request = new DeleteRegionNotificationEndpointRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - NotificationEndpoint = "notification_endpointbe78db22", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionNotificationEndpointsClient client = new RegionNotificationEndpointsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.NotificationEndpoint, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.NotificationEndpoint, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionNotificationEndpointRequest request = new GetRegionNotificationEndpointRequest { Region = "regionedb20d96", @@ -240,6 +60,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionNotificationEndpointRequest request = new GetRegionNotificationEndpointRequest { Region = "regionedb20d96", @@ -270,6 +91,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionNotificationEndpointRequest request = new GetRegionNotificationEndpointRequest { Region = "regionedb20d96", @@ -298,6 +120,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionNotificationEndpointRequest request = new GetRegionNotificationEndpointRequest { Region = "regionedb20d96", @@ -323,187 +146,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionNotificationEndpointRequest request = new InsertRegionNotificationEndpointRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - NotificationEndpointResource = new NotificationEndpoint(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionNotificationEndpointsClient client = new RegionNotificationEndpointsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionNotificationEndpointRequest request = new InsertRegionNotificationEndpointRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - NotificationEndpointResource = new NotificationEndpoint(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionNotificationEndpointsClient client = new RegionNotificationEndpointsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionNotificationEndpointRequest request = new InsertRegionNotificationEndpointRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - NotificationEndpointResource = new NotificationEndpoint(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionNotificationEndpointsClient client = new RegionNotificationEndpointsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.NotificationEndpointResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionNotificationEndpointRequest request = new InsertRegionNotificationEndpointRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - NotificationEndpointResource = new NotificationEndpoint(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionNotificationEndpointsClient client = new RegionNotificationEndpointsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.NotificationEndpointResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.NotificationEndpointResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionSslCertificatesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionSslCertificatesClientTest.g.cs index f878d0b67ac0..bc8be64f0ad8 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionSslCertificatesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionSslCertificatesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedRegionSslCertificatesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionSslCertificateRequest request = new DeleteRegionSslCertificateRequest - { - RequestId = "request_id362c8df6", - SslCertificate = "ssl_certificate25650c52", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionSslCertificatesClient client = new RegionSslCertificatesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionSslCertificateRequest request = new DeleteRegionSslCertificateRequest - { - RequestId = "request_id362c8df6", - SslCertificate = "ssl_certificate25650c52", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionSslCertificatesClient client = new RegionSslCertificatesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionSslCertificateRequest request = new DeleteRegionSslCertificateRequest - { - SslCertificate = "ssl_certificate25650c52", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionSslCertificatesClient client = new RegionSslCertificatesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.SslCertificate); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionSslCertificateRequest request = new DeleteRegionSslCertificateRequest - { - SslCertificate = "ssl_certificate25650c52", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionSslCertificatesClient client = new RegionSslCertificatesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.SslCertificate, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.SslCertificate, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionSslCertificateRequest request = new GetRegionSslCertificateRequest { SslCertificate = "ssl_certificate25650c52", @@ -249,6 +69,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionSslCertificateRequest request = new GetRegionSslCertificateRequest { SslCertificate = "ssl_certificate25650c52", @@ -288,6 +109,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionSslCertificateRequest request = new GetRegionSslCertificateRequest { SslCertificate = "ssl_certificate25650c52", @@ -325,6 +147,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionSslCertificateRequest request = new GetRegionSslCertificateRequest { SslCertificate = "ssl_certificate25650c52", @@ -359,187 +182,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionSslCertificateRequest request = new InsertRegionSslCertificateRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - SslCertificateResource = new SslCertificate(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionSslCertificatesClient client = new RegionSslCertificatesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionSslCertificateRequest request = new InsertRegionSslCertificateRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - SslCertificateResource = new SslCertificate(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionSslCertificatesClient client = new RegionSslCertificatesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionSslCertificateRequest request = new InsertRegionSslCertificateRequest - { - Region = "regionedb20d96", - SslCertificateResource = new SslCertificate(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionSslCertificatesClient client = new RegionSslCertificatesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.SslCertificateResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionSslCertificateRequest request = new InsertRegionSslCertificateRequest - { - Region = "regionedb20d96", - SslCertificateResource = new SslCertificate(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionSslCertificatesClient client = new RegionSslCertificatesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.SslCertificateResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.SslCertificateResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionTargetHttpProxiesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionTargetHttpProxiesClientTest.g.cs index 5a00e95d1e76..75309e771e1e 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionTargetHttpProxiesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionTargetHttpProxiesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedRegionTargetHttpProxiesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionTargetHttpProxyRequest request = new DeleteRegionTargetHttpProxyRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - TargetHttpProxy = "target_http_proxy02d2fd7b", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionTargetHttpProxiesClient client = new RegionTargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionTargetHttpProxyRequest request = new DeleteRegionTargetHttpProxyRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - TargetHttpProxy = "target_http_proxy02d2fd7b", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionTargetHttpProxiesClient client = new RegionTargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionTargetHttpProxyRequest request = new DeleteRegionTargetHttpProxyRequest - { - Region = "regionedb20d96", - TargetHttpProxy = "target_http_proxy02d2fd7b", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionTargetHttpProxiesClient client = new RegionTargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.TargetHttpProxy); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionTargetHttpProxyRequest request = new DeleteRegionTargetHttpProxyRequest - { - Region = "regionedb20d96", - TargetHttpProxy = "target_http_proxy02d2fd7b", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionTargetHttpProxiesClient client = new RegionTargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.TargetHttpProxy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.TargetHttpProxy, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionTargetHttpProxyRequest request = new GetRegionTargetHttpProxyRequest { Region = "regionedb20d96", @@ -242,6 +62,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionTargetHttpProxyRequest request = new GetRegionTargetHttpProxyRequest { Region = "regionedb20d96", @@ -274,6 +95,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionTargetHttpProxyRequest request = new GetRegionTargetHttpProxyRequest { Region = "regionedb20d96", @@ -304,6 +126,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionTargetHttpProxyRequest request = new GetRegionTargetHttpProxyRequest { Region = "regionedb20d96", @@ -331,373 +154,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionTargetHttpProxyRequest request = new InsertRegionTargetHttpProxyRequest - { - TargetHttpProxyResource = new TargetHttpProxy(), - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionTargetHttpProxiesClient client = new RegionTargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionTargetHttpProxyRequest request = new InsertRegionTargetHttpProxyRequest - { - TargetHttpProxyResource = new TargetHttpProxy(), - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionTargetHttpProxiesClient client = new RegionTargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionTargetHttpProxyRequest request = new InsertRegionTargetHttpProxyRequest - { - TargetHttpProxyResource = new TargetHttpProxy(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionTargetHttpProxiesClient client = new RegionTargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.TargetHttpProxyResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionTargetHttpProxyRequest request = new InsertRegionTargetHttpProxyRequest - { - TargetHttpProxyResource = new TargetHttpProxy(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionTargetHttpProxiesClient client = new RegionTargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.TargetHttpProxyResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.TargetHttpProxyResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetUrlMapRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetUrlMapRegionTargetHttpProxyRequest request = new SetUrlMapRegionTargetHttpProxyRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - TargetHttpProxy = "target_http_proxy02d2fd7b", - Project = "projectaa6ff846", - UrlMapReferenceResource = new UrlMapReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetUrlMap(request, moq::It.IsAny())).Returns(expectedResponse); - RegionTargetHttpProxiesClient client = new RegionTargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetUrlMap(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetUrlMapRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetUrlMapRegionTargetHttpProxyRequest request = new SetUrlMapRegionTargetHttpProxyRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - TargetHttpProxy = "target_http_proxy02d2fd7b", - Project = "projectaa6ff846", - UrlMapReferenceResource = new UrlMapReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetUrlMapAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionTargetHttpProxiesClient client = new RegionTargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetUrlMapAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetUrlMapAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetUrlMap() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetUrlMapRegionTargetHttpProxyRequest request = new SetUrlMapRegionTargetHttpProxyRequest - { - Region = "regionedb20d96", - TargetHttpProxy = "target_http_proxy02d2fd7b", - Project = "projectaa6ff846", - UrlMapReferenceResource = new UrlMapReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetUrlMap(request, moq::It.IsAny())).Returns(expectedResponse); - RegionTargetHttpProxiesClient client = new RegionTargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetUrlMap(request.Project, request.Region, request.TargetHttpProxy, request.UrlMapReferenceResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetUrlMapAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetUrlMapRegionTargetHttpProxyRequest request = new SetUrlMapRegionTargetHttpProxyRequest - { - Region = "regionedb20d96", - TargetHttpProxy = "target_http_proxy02d2fd7b", - Project = "projectaa6ff846", - UrlMapReferenceResource = new UrlMapReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetUrlMapAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionTargetHttpProxiesClient client = new RegionTargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetUrlMapAsync(request.Project, request.Region, request.TargetHttpProxy, request.UrlMapReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetUrlMapAsync(request.Project, request.Region, request.TargetHttpProxy, request.UrlMapReferenceResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionTargetHttpsProxiesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionTargetHttpsProxiesClientTest.g.cs index 608184ac237d..3867df20e46c 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionTargetHttpsProxiesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionTargetHttpsProxiesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedRegionTargetHttpsProxiesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionTargetHttpsProxyRequest request = new DeleteRegionTargetHttpsProxyRequest - { - RequestId = "request_id362c8df6", - TargetHttpsProxy = "target_https_proxycf436352", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionTargetHttpsProxiesClient client = new RegionTargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionTargetHttpsProxyRequest request = new DeleteRegionTargetHttpsProxyRequest - { - RequestId = "request_id362c8df6", - TargetHttpsProxy = "target_https_proxycf436352", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionTargetHttpsProxiesClient client = new RegionTargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionTargetHttpsProxyRequest request = new DeleteRegionTargetHttpsProxyRequest - { - TargetHttpsProxy = "target_https_proxycf436352", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionTargetHttpsProxiesClient client = new RegionTargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.TargetHttpsProxy); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionTargetHttpsProxyRequest request = new DeleteRegionTargetHttpsProxyRequest - { - TargetHttpsProxy = "target_https_proxycf436352", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionTargetHttpsProxiesClient client = new RegionTargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.TargetHttpsProxy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.TargetHttpsProxy, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionTargetHttpsProxyRequest request = new GetRegionTargetHttpsProxyRequest { TargetHttpsProxy = "target_https_proxycf436352", @@ -250,6 +70,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionTargetHttpsProxyRequest request = new GetRegionTargetHttpsProxyRequest { TargetHttpsProxy = "target_https_proxycf436352", @@ -290,6 +111,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionTargetHttpsProxyRequest request = new GetRegionTargetHttpsProxyRequest { TargetHttpsProxy = "target_https_proxycf436352", @@ -328,6 +150,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionTargetHttpsProxyRequest request = new GetRegionTargetHttpsProxyRequest { TargetHttpsProxy = "target_https_proxycf436352", @@ -363,559 +186,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionTargetHttpsProxyRequest request = new InsertRegionTargetHttpsProxyRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - TargetHttpsProxyResource = new TargetHttpsProxy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionTargetHttpsProxiesClient client = new RegionTargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionTargetHttpsProxyRequest request = new InsertRegionTargetHttpsProxyRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - TargetHttpsProxyResource = new TargetHttpsProxy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionTargetHttpsProxiesClient client = new RegionTargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionTargetHttpsProxyRequest request = new InsertRegionTargetHttpsProxyRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - TargetHttpsProxyResource = new TargetHttpsProxy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionTargetHttpsProxiesClient client = new RegionTargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.TargetHttpsProxyResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionTargetHttpsProxyRequest request = new InsertRegionTargetHttpsProxyRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - TargetHttpsProxyResource = new TargetHttpsProxy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionTargetHttpsProxiesClient client = new RegionTargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.TargetHttpsProxyResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.TargetHttpsProxyResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetSslCertificatesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSslCertificatesRegionTargetHttpsProxyRequest request = new SetSslCertificatesRegionTargetHttpsProxyRequest - { - RequestId = "request_id362c8df6", - TargetHttpsProxy = "target_https_proxycf436352", - Region = "regionedb20d96", - Project = "projectaa6ff846", - RegionTargetHttpsProxiesSetSslCertificatesRequestResource = new RegionTargetHttpsProxiesSetSslCertificatesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetSslCertificates(request, moq::It.IsAny())).Returns(expectedResponse); - RegionTargetHttpsProxiesClient client = new RegionTargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetSslCertificates(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetSslCertificatesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSslCertificatesRegionTargetHttpsProxyRequest request = new SetSslCertificatesRegionTargetHttpsProxyRequest - { - RequestId = "request_id362c8df6", - TargetHttpsProxy = "target_https_proxycf436352", - Region = "regionedb20d96", - Project = "projectaa6ff846", - RegionTargetHttpsProxiesSetSslCertificatesRequestResource = new RegionTargetHttpsProxiesSetSslCertificatesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetSslCertificatesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionTargetHttpsProxiesClient client = new RegionTargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetSslCertificatesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetSslCertificatesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetSslCertificates() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSslCertificatesRegionTargetHttpsProxyRequest request = new SetSslCertificatesRegionTargetHttpsProxyRequest - { - TargetHttpsProxy = "target_https_proxycf436352", - Region = "regionedb20d96", - Project = "projectaa6ff846", - RegionTargetHttpsProxiesSetSslCertificatesRequestResource = new RegionTargetHttpsProxiesSetSslCertificatesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetSslCertificates(request, moq::It.IsAny())).Returns(expectedResponse); - RegionTargetHttpsProxiesClient client = new RegionTargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetSslCertificates(request.Project, request.Region, request.TargetHttpsProxy, request.RegionTargetHttpsProxiesSetSslCertificatesRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetSslCertificatesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSslCertificatesRegionTargetHttpsProxyRequest request = new SetSslCertificatesRegionTargetHttpsProxyRequest - { - TargetHttpsProxy = "target_https_proxycf436352", - Region = "regionedb20d96", - Project = "projectaa6ff846", - RegionTargetHttpsProxiesSetSslCertificatesRequestResource = new RegionTargetHttpsProxiesSetSslCertificatesRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetSslCertificatesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionTargetHttpsProxiesClient client = new RegionTargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetSslCertificatesAsync(request.Project, request.Region, request.TargetHttpsProxy, request.RegionTargetHttpsProxiesSetSslCertificatesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetSslCertificatesAsync(request.Project, request.Region, request.TargetHttpsProxy, request.RegionTargetHttpsProxiesSetSslCertificatesRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetUrlMapRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetUrlMapRegionTargetHttpsProxyRequest request = new SetUrlMapRegionTargetHttpsProxyRequest - { - RequestId = "request_id362c8df6", - TargetHttpsProxy = "target_https_proxycf436352", - Region = "regionedb20d96", - Project = "projectaa6ff846", - UrlMapReferenceResource = new UrlMapReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetUrlMap(request, moq::It.IsAny())).Returns(expectedResponse); - RegionTargetHttpsProxiesClient client = new RegionTargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetUrlMap(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetUrlMapRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetUrlMapRegionTargetHttpsProxyRequest request = new SetUrlMapRegionTargetHttpsProxyRequest - { - RequestId = "request_id362c8df6", - TargetHttpsProxy = "target_https_proxycf436352", - Region = "regionedb20d96", - Project = "projectaa6ff846", - UrlMapReferenceResource = new UrlMapReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetUrlMapAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionTargetHttpsProxiesClient client = new RegionTargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetUrlMapAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetUrlMapAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetUrlMap() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetUrlMapRegionTargetHttpsProxyRequest request = new SetUrlMapRegionTargetHttpsProxyRequest - { - TargetHttpsProxy = "target_https_proxycf436352", - Region = "regionedb20d96", - Project = "projectaa6ff846", - UrlMapReferenceResource = new UrlMapReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetUrlMap(request, moq::It.IsAny())).Returns(expectedResponse); - RegionTargetHttpsProxiesClient client = new RegionTargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetUrlMap(request.Project, request.Region, request.TargetHttpsProxy, request.UrlMapReferenceResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetUrlMapAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetUrlMapRegionTargetHttpsProxyRequest request = new SetUrlMapRegionTargetHttpsProxyRequest - { - TargetHttpsProxy = "target_https_proxycf436352", - Region = "regionedb20d96", - Project = "projectaa6ff846", - UrlMapReferenceResource = new UrlMapReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetUrlMapAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionTargetHttpsProxiesClient client = new RegionTargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetUrlMapAsync(request.Project, request.Region, request.TargetHttpsProxy, request.UrlMapReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetUrlMapAsync(request.Project, request.Region, request.TargetHttpsProxy, request.UrlMapReferenceResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionUrlMapsClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionUrlMapsClientTest.g.cs index 9aa9ae6eb991..b8357b0393a6 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionUrlMapsClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RegionUrlMapsClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedRegionUrlMapsClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionUrlMapRequest request = new DeleteRegionUrlMapRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionUrlMapsClient client = new RegionUrlMapsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionUrlMapRequest request = new DeleteRegionUrlMapRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionUrlMapsClient client = new RegionUrlMapsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionUrlMapRequest request = new DeleteRegionUrlMapRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RegionUrlMapsClient client = new RegionUrlMapsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.UrlMap); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRegionUrlMapRequest request = new DeleteRegionUrlMapRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionUrlMapsClient client = new RegionUrlMapsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.UrlMap, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.UrlMap, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionUrlMapRequest request = new GetRegionUrlMapRequest { Region = "regionedb20d96", @@ -247,6 +67,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionUrlMapRequest request = new GetRegionUrlMapRequest { Region = "regionedb20d96", @@ -284,6 +105,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionUrlMapRequest request = new GetRegionUrlMapRequest { Region = "regionedb20d96", @@ -319,6 +141,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRegionUrlMapRequest request = new GetRegionUrlMapRequest { Region = "regionedb20d96", @@ -352,564 +175,11 @@ public void Get() mockGrpcClient.VerifyAll(); } - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionUrlMapRequest request = new InsertRegionUrlMapRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionUrlMapsClient client = new RegionUrlMapsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionUrlMapRequest request = new InsertRegionUrlMapRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionUrlMapsClient client = new RegionUrlMapsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionUrlMapRequest request = new InsertRegionUrlMapRequest - { - Region = "regionedb20d96", - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RegionUrlMapsClient client = new RegionUrlMapsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.UrlMapResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRegionUrlMapRequest request = new InsertRegionUrlMapRequest - { - Region = "regionedb20d96", - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionUrlMapsClient client = new RegionUrlMapsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.UrlMapResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.UrlMapResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionUrlMapRequest request = new PatchRegionUrlMapRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - RegionUrlMapsClient client = new RegionUrlMapsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionUrlMapRequest request = new PatchRegionUrlMapRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionUrlMapsClient client = new RegionUrlMapsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionUrlMapRequest request = new PatchRegionUrlMapRequest - { - Region = "regionedb20d96", - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - RegionUrlMapsClient client = new RegionUrlMapsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.Region, request.UrlMap, request.UrlMapResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRegionUrlMapRequest request = new PatchRegionUrlMapRequest - { - Region = "regionedb20d96", - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionUrlMapsClient client = new RegionUrlMapsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.Region, request.UrlMap, request.UrlMapResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.Region, request.UrlMap, request.UrlMapResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void UpdateRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateRegionUrlMapRequest request = new UpdateRegionUrlMapRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); - RegionUrlMapsClient client = new RegionUrlMapsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task UpdateRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateRegionUrlMapRequest request = new UpdateRegionUrlMapRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionUrlMapsClient client = new RegionUrlMapsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Update() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateRegionUrlMapRequest request = new UpdateRegionUrlMapRequest - { - Region = "regionedb20d96", - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); - RegionUrlMapsClient client = new RegionUrlMapsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request.Project, request.Region, request.UrlMap, request.UrlMapResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task UpdateAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateRegionUrlMapRequest request = new UpdateRegionUrlMapRequest - { - Region = "regionedb20d96", - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RegionUrlMapsClient client = new RegionUrlMapsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request.Project, request.Region, request.UrlMap, request.UrlMapResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request.Project, request.Region, request.UrlMap, request.UrlMapResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void ValidateRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); ValidateRegionUrlMapRequest request = new ValidateRegionUrlMapRequest { RegionUrlMapsValidateRequestResource = new RegionUrlMapsValidateRequest(), @@ -932,6 +202,7 @@ public void ValidateRequestObject() public async stt::Task ValidateRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); ValidateRegionUrlMapRequest request = new ValidateRegionUrlMapRequest { RegionUrlMapsValidateRequestResource = new RegionUrlMapsValidateRequest(), @@ -956,6 +227,7 @@ public void ValidateRequestObject() public void Validate() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); ValidateRegionUrlMapRequest request = new ValidateRegionUrlMapRequest { RegionUrlMapsValidateRequestResource = new RegionUrlMapsValidateRequest(), @@ -978,6 +250,7 @@ public void Validate() public async stt::Task ValidateAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); ValidateRegionUrlMapRequest request = new ValidateRegionUrlMapRequest { RegionUrlMapsValidateRequestResource = new RegionUrlMapsValidateRequest(), diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ReservationsClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ReservationsClientTest.g.cs index 4b017387da0e..20df1ff08145 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ReservationsClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ReservationsClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedReservationsClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteReservationRequest request = new DeleteReservationRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Reservation = "reservationf22d3388", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - ReservationsClient client = new ReservationsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteReservationRequest request = new DeleteReservationRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Reservation = "reservationf22d3388", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ReservationsClient client = new ReservationsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteReservationRequest request = new DeleteReservationRequest - { - Zone = "zone255f4ea8", - Reservation = "reservationf22d3388", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - ReservationsClient client = new ReservationsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Zone, request.Reservation); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteReservationRequest request = new DeleteReservationRequest - { - Zone = "zone255f4ea8", - Reservation = "reservationf22d3388", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ReservationsClient client = new ReservationsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Zone, request.Reservation, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Zone, request.Reservation, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetReservationRequest request = new GetReservationRequest { Zone = "zone255f4ea8", @@ -244,6 +64,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetReservationRequest request = new GetReservationRequest { Zone = "zone255f4ea8", @@ -278,6 +99,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetReservationRequest request = new GetReservationRequest { Zone = "zone255f4ea8", @@ -310,6 +132,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetReservationRequest request = new GetReservationRequest { Zone = "zone255f4ea8", @@ -344,6 +167,7 @@ public void Get() public void GetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetIamPolicyReservationRequest request = new GetIamPolicyReservationRequest { Zone = "zone255f4ea8", @@ -371,6 +195,7 @@ public void GetIamPolicyRequestObject() public async stt::Task GetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetIamPolicyReservationRequest request = new GetIamPolicyReservationRequest { Zone = "zone255f4ea8", @@ -400,6 +225,7 @@ public void GetIamPolicyRequestObject() public void GetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetIamPolicyReservationRequest request = new GetIamPolicyReservationRequest { Zone = "zone255f4ea8", @@ -426,6 +252,7 @@ public void GetIamPolicy() public async stt::Task GetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetIamPolicyReservationRequest request = new GetIamPolicyReservationRequest { Zone = "zone255f4ea8", @@ -450,378 +277,11 @@ public void GetIamPolicy() mockGrpcClient.VerifyAll(); } - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertReservationRequest request = new InsertReservationRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - ReservationResource = new Reservation(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - ReservationsClient client = new ReservationsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertReservationRequest request = new InsertReservationRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - ReservationResource = new Reservation(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ReservationsClient client = new ReservationsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertReservationRequest request = new InsertReservationRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - ReservationResource = new Reservation(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - ReservationsClient client = new ReservationsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Zone, request.ReservationResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertReservationRequest request = new InsertReservationRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - ReservationResource = new Reservation(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ReservationsClient client = new ReservationsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Zone, request.ReservationResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Zone, request.ReservationResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void ResizeRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResizeReservationRequest request = new ResizeReservationRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Reservation = "reservationf22d3388", - Project = "projectaa6ff846", - ReservationsResizeRequestResource = new ReservationsResizeRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Resize(request, moq::It.IsAny())).Returns(expectedResponse); - ReservationsClient client = new ReservationsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Resize(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task ResizeRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResizeReservationRequest request = new ResizeReservationRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Reservation = "reservationf22d3388", - Project = "projectaa6ff846", - ReservationsResizeRequestResource = new ReservationsResizeRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.ResizeAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ReservationsClient client = new ReservationsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.ResizeAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.ResizeAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Resize() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResizeReservationRequest request = new ResizeReservationRequest - { - Zone = "zone255f4ea8", - Reservation = "reservationf22d3388", - Project = "projectaa6ff846", - ReservationsResizeRequestResource = new ReservationsResizeRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Resize(request, moq::It.IsAny())).Returns(expectedResponse); - ReservationsClient client = new ReservationsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Resize(request.Project, request.Zone, request.Reservation, request.ReservationsResizeRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task ResizeAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ResizeReservationRequest request = new ResizeReservationRequest - { - Zone = "zone255f4ea8", - Reservation = "reservationf22d3388", - Project = "projectaa6ff846", - ReservationsResizeRequestResource = new ReservationsResizeRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.ResizeAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ReservationsClient client = new ReservationsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.ResizeAsync(request.Project, request.Zone, request.Reservation, request.ReservationsResizeRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.ResizeAsync(request.Project, request.Zone, request.Reservation, request.ReservationsResizeRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void SetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); SetIamPolicyReservationRequest request = new SetIamPolicyReservationRequest { Zone = "zone255f4ea8", @@ -849,6 +309,7 @@ public void SetIamPolicyRequestObject() public async stt::Task SetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); SetIamPolicyReservationRequest request = new SetIamPolicyReservationRequest { Zone = "zone255f4ea8", @@ -878,6 +339,7 @@ public void SetIamPolicyRequestObject() public void SetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); SetIamPolicyReservationRequest request = new SetIamPolicyReservationRequest { Zone = "zone255f4ea8", @@ -905,6 +367,7 @@ public void SetIamPolicy() public async stt::Task SetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); SetIamPolicyReservationRequest request = new SetIamPolicyReservationRequest { Zone = "zone255f4ea8", @@ -934,6 +397,7 @@ public void SetIamPolicy() public void TestIamPermissionsRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); TestIamPermissionsReservationRequest request = new TestIamPermissionsReservationRequest { Zone = "zone255f4ea8", @@ -959,6 +423,7 @@ public void TestIamPermissionsRequestObject() public async stt::Task TestIamPermissionsRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); TestIamPermissionsReservationRequest request = new TestIamPermissionsReservationRequest { Zone = "zone255f4ea8", @@ -986,6 +451,7 @@ public void TestIamPermissionsRequestObject() public void TestIamPermissions() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); TestIamPermissionsReservationRequest request = new TestIamPermissionsReservationRequest { Zone = "zone255f4ea8", @@ -1011,6 +477,7 @@ public void TestIamPermissions() public async stt::Task TestIamPermissionsAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); TestIamPermissionsReservationRequest request = new TestIamPermissionsReservationRequest { Zone = "zone255f4ea8", diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ResourcePoliciesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ResourcePoliciesClientTest.g.cs index 77253fea5fa9..8a2d9a3ac4ff 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ResourcePoliciesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/ResourcePoliciesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedResourcePoliciesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteResourcePolicyRequest request = new DeleteResourcePolicyRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - ResourcePolicy = "resource_policydde7e557", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - ResourcePoliciesClient client = new ResourcePoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteResourcePolicyRequest request = new DeleteResourcePolicyRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - ResourcePolicy = "resource_policydde7e557", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ResourcePoliciesClient client = new ResourcePoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteResourcePolicyRequest request = new DeleteResourcePolicyRequest - { - Region = "regionedb20d96", - ResourcePolicy = "resource_policydde7e557", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - ResourcePoliciesClient client = new ResourcePoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.ResourcePolicy); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteResourcePolicyRequest request = new DeleteResourcePolicyRequest - { - Region = "regionedb20d96", - ResourcePolicy = "resource_policydde7e557", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ResourcePoliciesClient client = new ResourcePoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.ResourcePolicy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.ResourcePolicy, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetResourcePolicyRequest request = new GetResourcePolicyRequest { Region = "regionedb20d96", @@ -244,6 +64,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetResourcePolicyRequest request = new GetResourcePolicyRequest { Region = "regionedb20d96", @@ -278,6 +99,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetResourcePolicyRequest request = new GetResourcePolicyRequest { Region = "regionedb20d96", @@ -310,6 +132,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetResourcePolicyRequest request = new GetResourcePolicyRequest { Region = "regionedb20d96", @@ -344,6 +167,7 @@ public void Get() public void GetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetIamPolicyResourcePolicyRequest request = new GetIamPolicyResourcePolicyRequest { Region = "regionedb20d96", @@ -371,6 +195,7 @@ public void GetIamPolicyRequestObject() public async stt::Task GetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetIamPolicyResourcePolicyRequest request = new GetIamPolicyResourcePolicyRequest { Region = "regionedb20d96", @@ -400,6 +225,7 @@ public void GetIamPolicyRequestObject() public void GetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetIamPolicyResourcePolicyRequest request = new GetIamPolicyResourcePolicyRequest { Region = "regionedb20d96", @@ -426,6 +252,7 @@ public void GetIamPolicy() public async stt::Task GetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetIamPolicyResourcePolicyRequest request = new GetIamPolicyResourcePolicyRequest { Region = "regionedb20d96", @@ -450,192 +277,11 @@ public void GetIamPolicy() mockGrpcClient.VerifyAll(); } - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertResourcePolicyRequest request = new InsertResourcePolicyRequest - { - RequestId = "request_id362c8df6", - ResourcePolicyResource = new ResourcePolicy(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - ResourcePoliciesClient client = new ResourcePoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertResourcePolicyRequest request = new InsertResourcePolicyRequest - { - RequestId = "request_id362c8df6", - ResourcePolicyResource = new ResourcePolicy(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ResourcePoliciesClient client = new ResourcePoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertResourcePolicyRequest request = new InsertResourcePolicyRequest - { - ResourcePolicyResource = new ResourcePolicy(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - ResourcePoliciesClient client = new ResourcePoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.ResourcePolicyResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertResourcePolicyRequest request = new InsertResourcePolicyRequest - { - ResourcePolicyResource = new ResourcePolicy(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - ResourcePoliciesClient client = new ResourcePoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.ResourcePolicyResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.ResourcePolicyResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void SetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); SetIamPolicyResourcePolicyRequest request = new SetIamPolicyResourcePolicyRequest { Region = "regionedb20d96", @@ -663,6 +309,7 @@ public void SetIamPolicyRequestObject() public async stt::Task SetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); SetIamPolicyResourcePolicyRequest request = new SetIamPolicyResourcePolicyRequest { Region = "regionedb20d96", @@ -692,6 +339,7 @@ public void SetIamPolicyRequestObject() public void SetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); SetIamPolicyResourcePolicyRequest request = new SetIamPolicyResourcePolicyRequest { Region = "regionedb20d96", @@ -719,6 +367,7 @@ public void SetIamPolicy() public async stt::Task SetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); SetIamPolicyResourcePolicyRequest request = new SetIamPolicyResourcePolicyRequest { Region = "regionedb20d96", @@ -748,6 +397,7 @@ public void SetIamPolicy() public void TestIamPermissionsRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsResourcePolicyRequest request = new TestIamPermissionsResourcePolicyRequest { Region = "regionedb20d96", @@ -773,6 +423,7 @@ public void TestIamPermissionsRequestObject() public async stt::Task TestIamPermissionsRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsResourcePolicyRequest request = new TestIamPermissionsResourcePolicyRequest { Region = "regionedb20d96", @@ -800,6 +451,7 @@ public void TestIamPermissionsRequestObject() public void TestIamPermissions() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsResourcePolicyRequest request = new TestIamPermissionsResourcePolicyRequest { Region = "regionedb20d96", @@ -825,6 +477,7 @@ public void TestIamPermissions() public async stt::Task TestIamPermissionsAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsResourcePolicyRequest request = new TestIamPermissionsResourcePolicyRequest { Region = "regionedb20d96", diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RoutersClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RoutersClientTest.g.cs index add97751dd62..14bb574c5319 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RoutersClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RoutersClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedRoutersClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRouterRequest request = new DeleteRouterRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Router = "routerd55c39f3", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RoutersClient client = new RoutersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRouterRequest request = new DeleteRouterRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Router = "routerd55c39f3", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RoutersClient client = new RoutersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRouterRequest request = new DeleteRouterRequest - { - Region = "regionedb20d96", - Router = "routerd55c39f3", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RoutersClient client = new RoutersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.Router); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRouterRequest request = new DeleteRouterRequest - { - Region = "regionedb20d96", - Router = "routerd55c39f3", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RoutersClient client = new RoutersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.Router, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.Router, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRouterRequest request = new GetRouterRequest { Region = "regionedb20d96", @@ -251,6 +71,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRouterRequest request = new GetRouterRequest { Region = "regionedb20d96", @@ -292,6 +113,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRouterRequest request = new GetRouterRequest { Region = "regionedb20d96", @@ -331,6 +153,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRouterRequest request = new GetRouterRequest { Region = "regionedb20d96", @@ -372,6 +195,7 @@ public void Get() public void GetRouterStatusRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRouterStatusRouterRequest request = new GetRouterStatusRouterRequest { Region = "regionedb20d96", @@ -394,6 +218,7 @@ public void GetRouterStatusRequestObject() public async stt::Task GetRouterStatusRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRouterStatusRouterRequest request = new GetRouterStatusRouterRequest { Region = "regionedb20d96", @@ -418,6 +243,7 @@ public void GetRouterStatusRequestObject() public void GetRouterStatus() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRouterStatusRouterRequest request = new GetRouterStatusRouterRequest { Region = "regionedb20d96", @@ -440,6 +266,7 @@ public void GetRouterStatus() public async stt::Task GetRouterStatusAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetRouterStatusRouterRequest request = new GetRouterStatusRouterRequest { Region = "regionedb20d96", @@ -460,378 +287,11 @@ public void GetRouterStatus() mockGrpcClient.VerifyAll(); } - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRouterRequest request = new InsertRouterRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - RouterResource = new Router(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RoutersClient client = new RoutersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRouterRequest request = new InsertRouterRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - RouterResource = new Router(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RoutersClient client = new RoutersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRouterRequest request = new InsertRouterRequest - { - Region = "regionedb20d96", - RouterResource = new Router(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RoutersClient client = new RoutersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.RouterResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRouterRequest request = new InsertRouterRequest - { - Region = "regionedb20d96", - RouterResource = new Router(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RoutersClient client = new RoutersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.RouterResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.RouterResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRouterRequest request = new PatchRouterRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Router = "routerd55c39f3", - RouterResource = new Router(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - RoutersClient client = new RoutersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRouterRequest request = new PatchRouterRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Router = "routerd55c39f3", - RouterResource = new Router(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RoutersClient client = new RoutersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRouterRequest request = new PatchRouterRequest - { - Region = "regionedb20d96", - Router = "routerd55c39f3", - RouterResource = new Router(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - RoutersClient client = new RoutersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.Region, request.Router, request.RouterResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRouterRequest request = new PatchRouterRequest - { - Region = "regionedb20d96", - Router = "routerd55c39f3", - RouterResource = new Router(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RoutersClient client = new RoutersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.Region, request.Router, request.RouterResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.Region, request.Router, request.RouterResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void PreviewRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); PreviewRouterRequest request = new PreviewRouterRequest { Region = "regionedb20d96", @@ -854,6 +314,7 @@ public void PreviewRequestObject() public async stt::Task PreviewRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); PreviewRouterRequest request = new PreviewRouterRequest { Region = "regionedb20d96", @@ -878,6 +339,7 @@ public void PreviewRequestObject() public void Preview() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); PreviewRouterRequest request = new PreviewRouterRequest { Region = "regionedb20d96", @@ -900,6 +362,7 @@ public void Preview() public async stt::Task PreviewAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); PreviewRouterRequest request = new PreviewRouterRequest { Region = "regionedb20d96", @@ -919,191 +382,5 @@ public void Preview() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void UpdateRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateRouterRequest request = new UpdateRouterRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Router = "routerd55c39f3", - RouterResource = new Router(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); - RoutersClient client = new RoutersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task UpdateRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateRouterRequest request = new UpdateRouterRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Router = "routerd55c39f3", - RouterResource = new Router(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RoutersClient client = new RoutersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Update() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateRouterRequest request = new UpdateRouterRequest - { - Region = "regionedb20d96", - Router = "routerd55c39f3", - RouterResource = new Router(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); - RoutersClient client = new RoutersClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request.Project, request.Region, request.Router, request.RouterResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task UpdateAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateRouterRequest request = new UpdateRouterRequest - { - Region = "regionedb20d96", - Router = "routerd55c39f3", - RouterResource = new Router(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RoutersClient client = new RoutersClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request.Project, request.Region, request.Router, request.RouterResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request.Project, request.Region, request.Router, request.RouterResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RoutesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RoutesClientTest.g.cs index f180e4c9853b..fb226291474d 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RoutesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/RoutesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,188 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedRoutesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRouteRequest request = new DeleteRouteRequest - { - RequestId = "request_id362c8df6", - Route = "route8a40469c", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RoutesClient client = new RoutesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRouteRequest request = new DeleteRouteRequest - { - RequestId = "request_id362c8df6", - Route = "route8a40469c", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RoutesClient client = new RoutesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRouteRequest request = new DeleteRouteRequest - { - Route = "route8a40469c", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - RoutesClient client = new RoutesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Route); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteRouteRequest request = new DeleteRouteRequest - { - Route = "route8a40469c", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RoutesClient client = new RoutesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Route, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Route, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetRouteRequest request = new GetRouteRequest { Route = "route8a40469c", @@ -245,6 +69,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetRouteRequest request = new GetRouteRequest { Route = "route8a40469c", @@ -284,6 +109,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetRouteRequest request = new GetRouteRequest { Route = "route8a40469c", @@ -321,6 +147,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetRouteRequest request = new GetRouteRequest { Route = "route8a40469c", @@ -355,183 +182,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRouteRequest request = new InsertRouteRequest - { - RequestId = "request_id362c8df6", - RouteResource = new Route(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RoutesClient client = new RoutesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRouteRequest request = new InsertRouteRequest - { - RequestId = "request_id362c8df6", - RouteResource = new Route(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RoutesClient client = new RoutesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRouteRequest request = new InsertRouteRequest - { - RouteResource = new Route(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - RoutesClient client = new RoutesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.RouteResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertRouteRequest request = new InsertRouteRequest - { - RouteResource = new Route(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - RoutesClient client = new RoutesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.RouteResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.RouteResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/SecurityPoliciesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/SecurityPoliciesClientTest.g.cs index efddc4c434c1..2fbad38935db 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/SecurityPoliciesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/SecurityPoliciesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,368 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedSecurityPoliciesClientTest { - [xunit::FactAttribute] - public void AddRuleRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddRuleSecurityPolicyRequest request = new AddRuleSecurityPolicyRequest - { - SecurityPolicy = "security_policy76596315", - Project = "projectaa6ff846", - SecurityPolicyRuleResource = new SecurityPolicyRule(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddRule(request, moq::It.IsAny())).Returns(expectedResponse); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddRule(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddRuleRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddRuleSecurityPolicyRequest request = new AddRuleSecurityPolicyRequest - { - SecurityPolicy = "security_policy76596315", - Project = "projectaa6ff846", - SecurityPolicyRuleResource = new SecurityPolicyRule(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddRuleAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddRuleAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddRuleAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void AddRule() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddRuleSecurityPolicyRequest request = new AddRuleSecurityPolicyRequest - { - SecurityPolicy = "security_policy76596315", - Project = "projectaa6ff846", - SecurityPolicyRuleResource = new SecurityPolicyRule(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddRule(request, moq::It.IsAny())).Returns(expectedResponse); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddRule(request.Project, request.SecurityPolicy, request.SecurityPolicyRuleResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddRuleAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddRuleSecurityPolicyRequest request = new AddRuleSecurityPolicyRequest - { - SecurityPolicy = "security_policy76596315", - Project = "projectaa6ff846", - SecurityPolicyRuleResource = new SecurityPolicyRule(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddRuleAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddRuleAsync(request.Project, request.SecurityPolicy, request.SecurityPolicyRuleResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddRuleAsync(request.Project, request.SecurityPolicy, request.SecurityPolicyRuleResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSecurityPolicyRequest request = new DeleteSecurityPolicyRequest - { - RequestId = "request_id362c8df6", - SecurityPolicy = "security_policy76596315", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSecurityPolicyRequest request = new DeleteSecurityPolicyRequest - { - RequestId = "request_id362c8df6", - SecurityPolicy = "security_policy76596315", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSecurityPolicyRequest request = new DeleteSecurityPolicyRequest - { - SecurityPolicy = "security_policy76596315", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.SecurityPolicy); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSecurityPolicyRequest request = new DeleteSecurityPolicyRequest - { - SecurityPolicy = "security_policy76596315", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.SecurityPolicy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.SecurityPolicy, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetSecurityPolicyRequest request = new GetSecurityPolicyRequest { SecurityPolicy = "security_policy76596315", @@ -418,6 +62,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetSecurityPolicyRequest request = new GetSecurityPolicyRequest { SecurityPolicy = "security_policy76596315", @@ -450,6 +95,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetSecurityPolicyRequest request = new GetSecurityPolicyRequest { SecurityPolicy = "security_policy76596315", @@ -480,6 +126,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetSecurityPolicyRequest request = new GetSecurityPolicyRequest { SecurityPolicy = "security_policy76596315", @@ -512,6 +159,7 @@ public void Get() public void GetRuleRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetRuleSecurityPolicyRequest request = new GetRuleSecurityPolicyRequest { SecurityPolicy = "security_policy76596315", @@ -538,6 +186,7 @@ public void GetRuleRequestObject() public async stt::Task GetRuleRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetRuleSecurityPolicyRequest request = new GetRuleSecurityPolicyRequest { SecurityPolicy = "security_policy76596315", @@ -566,6 +215,7 @@ public void GetRuleRequestObject() public void GetRule() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetRuleSecurityPolicyRequest request = new GetRuleSecurityPolicyRequest { SecurityPolicy = "security_policy76596315", @@ -591,6 +241,7 @@ public void GetRule() public async stt::Task GetRuleAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetRuleSecurityPolicyRequest request = new GetRuleSecurityPolicyRequest { SecurityPolicy = "security_policy76596315", @@ -614,188 +265,11 @@ public void GetRule() mockGrpcClient.VerifyAll(); } - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertSecurityPolicyRequest request = new InsertSecurityPolicyRequest - { - RequestId = "request_id362c8df6", - SecurityPolicyResource = new SecurityPolicy(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertSecurityPolicyRequest request = new InsertSecurityPolicyRequest - { - RequestId = "request_id362c8df6", - SecurityPolicyResource = new SecurityPolicy(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertSecurityPolicyRequest request = new InsertSecurityPolicyRequest - { - SecurityPolicyResource = new SecurityPolicy(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.SecurityPolicyResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertSecurityPolicyRequest request = new InsertSecurityPolicyRequest - { - SecurityPolicyResource = new SecurityPolicy(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.SecurityPolicyResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.SecurityPolicyResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void ListPreconfiguredExpressionSetsRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); ListPreconfiguredExpressionSetsSecurityPoliciesRequest request = new ListPreconfiguredExpressionSetsSecurityPoliciesRequest { PageToken = "page_tokenf09e5538", @@ -820,6 +294,7 @@ public void ListPreconfiguredExpressionSetsRequestObject() public async stt::Task ListPreconfiguredExpressionSetsRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); ListPreconfiguredExpressionSetsSecurityPoliciesRequest request = new ListPreconfiguredExpressionSetsSecurityPoliciesRequest { PageToken = "page_tokenf09e5538", @@ -846,6 +321,7 @@ public void ListPreconfiguredExpressionSetsRequestObject() public void ListPreconfiguredExpressionSets() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); ListPreconfiguredExpressionSetsSecurityPoliciesRequest request = new ListPreconfiguredExpressionSetsSecurityPoliciesRequest { Project = "projectaa6ff846", @@ -865,6 +341,7 @@ public void ListPreconfiguredExpressionSets() public async stt::Task ListPreconfiguredExpressionSetsAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); ListPreconfiguredExpressionSetsSecurityPoliciesRequest request = new ListPreconfiguredExpressionSetsSecurityPoliciesRequest { Project = "projectaa6ff846", @@ -881,547 +358,5 @@ public void ListPreconfiguredExpressionSets() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchSecurityPolicyRequest request = new PatchSecurityPolicyRequest - { - RequestId = "request_id362c8df6", - SecurityPolicy = "security_policy76596315", - SecurityPolicyResource = new SecurityPolicy(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchSecurityPolicyRequest request = new PatchSecurityPolicyRequest - { - RequestId = "request_id362c8df6", - SecurityPolicy = "security_policy76596315", - SecurityPolicyResource = new SecurityPolicy(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchSecurityPolicyRequest request = new PatchSecurityPolicyRequest - { - SecurityPolicy = "security_policy76596315", - SecurityPolicyResource = new SecurityPolicy(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.SecurityPolicy, request.SecurityPolicyResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchSecurityPolicyRequest request = new PatchSecurityPolicyRequest - { - SecurityPolicy = "security_policy76596315", - SecurityPolicyResource = new SecurityPolicy(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.SecurityPolicy, request.SecurityPolicyResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.SecurityPolicy, request.SecurityPolicyResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRuleRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRuleSecurityPolicyRequest request = new PatchRuleSecurityPolicyRequest - { - SecurityPolicy = "security_policy76596315", - Project = "projectaa6ff846", - SecurityPolicyRuleResource = new SecurityPolicyRule(), - Priority = 1546225849, - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchRule(request, moq::It.IsAny())).Returns(expectedResponse); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.PatchRule(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRuleRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRuleSecurityPolicyRequest request = new PatchRuleSecurityPolicyRequest - { - SecurityPolicy = "security_policy76596315", - Project = "projectaa6ff846", - SecurityPolicyRuleResource = new SecurityPolicyRule(), - Priority = 1546225849, - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchRuleAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchRuleAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchRuleAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRule() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRuleSecurityPolicyRequest request = new PatchRuleSecurityPolicyRequest - { - SecurityPolicy = "security_policy76596315", - Project = "projectaa6ff846", - SecurityPolicyRuleResource = new SecurityPolicyRule(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchRule(request, moq::It.IsAny())).Returns(expectedResponse); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.PatchRule(request.Project, request.SecurityPolicy, request.SecurityPolicyRuleResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRuleAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchRuleSecurityPolicyRequest request = new PatchRuleSecurityPolicyRequest - { - SecurityPolicy = "security_policy76596315", - Project = "projectaa6ff846", - SecurityPolicyRuleResource = new SecurityPolicyRule(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchRuleAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchRuleAsync(request.Project, request.SecurityPolicy, request.SecurityPolicyRuleResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchRuleAsync(request.Project, request.SecurityPolicy, request.SecurityPolicyRuleResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void RemoveRuleRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveRuleSecurityPolicyRequest request = new RemoveRuleSecurityPolicyRequest - { - SecurityPolicy = "security_policy76596315", - Project = "projectaa6ff846", - Priority = 1546225849, - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveRule(request, moq::It.IsAny())).Returns(expectedResponse); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.RemoveRule(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task RemoveRuleRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveRuleSecurityPolicyRequest request = new RemoveRuleSecurityPolicyRequest - { - SecurityPolicy = "security_policy76596315", - Project = "projectaa6ff846", - Priority = 1546225849, - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveRuleAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RemoveRuleAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RemoveRuleAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void RemoveRule() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveRuleSecurityPolicyRequest request = new RemoveRuleSecurityPolicyRequest - { - SecurityPolicy = "security_policy76596315", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveRule(request, moq::It.IsAny())).Returns(expectedResponse); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.RemoveRule(request.Project, request.SecurityPolicy); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task RemoveRuleAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveRuleSecurityPolicyRequest request = new RemoveRuleSecurityPolicyRequest - { - SecurityPolicy = "security_policy76596315", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveRuleAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SecurityPoliciesClient client = new SecurityPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RemoveRuleAsync(request.Project, request.SecurityPolicy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RemoveRuleAsync(request.Project, request.SecurityPolicy, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/SnapshotsClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/SnapshotsClientTest.g.cs index a039cdb712ce..aa1cf408cec9 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/SnapshotsClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/SnapshotsClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,188 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedSnapshotsClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSnapshotRequest request = new DeleteSnapshotRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - Snapshot = "snapshotded322c3", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - SnapshotsClient client = new SnapshotsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSnapshotRequest request = new DeleteSnapshotRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - Snapshot = "snapshotded322c3", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SnapshotsClient client = new SnapshotsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSnapshotRequest request = new DeleteSnapshotRequest - { - Project = "projectaa6ff846", - Snapshot = "snapshotded322c3", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - SnapshotsClient client = new SnapshotsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Snapshot); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSnapshotRequest request = new DeleteSnapshotRequest - { - Project = "projectaa6ff846", - Snapshot = "snapshotded322c3", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SnapshotsClient client = new SnapshotsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Snapshot, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Snapshot, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetSnapshotRequest request = new GetSnapshotRequest { Project = "projectaa6ff846", @@ -266,6 +90,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetSnapshotRequest request = new GetSnapshotRequest { Project = "projectaa6ff846", @@ -326,6 +151,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetSnapshotRequest request = new GetSnapshotRequest { Project = "projectaa6ff846", @@ -384,6 +210,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetSnapshotRequest request = new GetSnapshotRequest { Project = "projectaa6ff846", @@ -444,6 +271,7 @@ public void Get() public void GetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetIamPolicySnapshotRequest request = new GetIamPolicySnapshotRequest { Resource = "resource164eab96", @@ -470,6 +298,7 @@ public void GetIamPolicyRequestObject() public async stt::Task GetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetIamPolicySnapshotRequest request = new GetIamPolicySnapshotRequest { Resource = "resource164eab96", @@ -498,6 +327,7 @@ public void GetIamPolicyRequestObject() public void GetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetIamPolicySnapshotRequest request = new GetIamPolicySnapshotRequest { Resource = "resource164eab96", @@ -523,6 +353,7 @@ public void GetIamPolicy() public async stt::Task GetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetIamPolicySnapshotRequest request = new GetIamPolicySnapshotRequest { Resource = "resource164eab96", @@ -550,6 +381,7 @@ public void GetIamPolicy() public void SetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); SetIamPolicySnapshotRequest request = new SetIamPolicySnapshotRequest { Resource = "resource164eab96", @@ -576,6 +408,7 @@ public void SetIamPolicyRequestObject() public async stt::Task SetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); SetIamPolicySnapshotRequest request = new SetIamPolicySnapshotRequest { Resource = "resource164eab96", @@ -604,6 +437,7 @@ public void SetIamPolicyRequestObject() public void SetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); SetIamPolicySnapshotRequest request = new SetIamPolicySnapshotRequest { Resource = "resource164eab96", @@ -630,6 +464,7 @@ public void SetIamPolicy() public async stt::Task SetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); SetIamPolicySnapshotRequest request = new SetIamPolicySnapshotRequest { Resource = "resource164eab96", @@ -654,190 +489,11 @@ public void SetIamPolicy() mockGrpcClient.VerifyAll(); } - [xunit::FactAttribute] - public void SetLabelsRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsSnapshotRequest request = new SetLabelsSnapshotRequest - { - Resource = "resource164eab96", - Project = "projectaa6ff846", - GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabels(request, moq::It.IsAny())).Returns(expectedResponse); - SnapshotsClient client = new SnapshotsClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetLabels(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetLabelsRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsSnapshotRequest request = new SetLabelsSnapshotRequest - { - Resource = "resource164eab96", - Project = "projectaa6ff846", - GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabelsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SnapshotsClient client = new SnapshotsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetLabelsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetLabelsAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetLabels() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsSnapshotRequest request = new SetLabelsSnapshotRequest - { - Resource = "resource164eab96", - Project = "projectaa6ff846", - GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabels(request, moq::It.IsAny())).Returns(expectedResponse); - SnapshotsClient client = new SnapshotsClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetLabels(request.Project, request.Resource, request.GlobalSetLabelsRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetLabelsAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsSnapshotRequest request = new SetLabelsSnapshotRequest - { - Resource = "resource164eab96", - Project = "projectaa6ff846", - GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabelsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SnapshotsClient client = new SnapshotsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetLabelsAsync(request.Project, request.Resource, request.GlobalSetLabelsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetLabelsAsync(request.Project, request.Resource, request.GlobalSetLabelsRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void TestIamPermissionsRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); TestIamPermissionsSnapshotRequest request = new TestIamPermissionsSnapshotRequest { Resource = "resource164eab96", @@ -862,6 +518,7 @@ public void TestIamPermissionsRequestObject() public async stt::Task TestIamPermissionsRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); TestIamPermissionsSnapshotRequest request = new TestIamPermissionsSnapshotRequest { Resource = "resource164eab96", @@ -888,6 +545,7 @@ public void TestIamPermissionsRequestObject() public void TestIamPermissions() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); TestIamPermissionsSnapshotRequest request = new TestIamPermissionsSnapshotRequest { Resource = "resource164eab96", @@ -912,6 +570,7 @@ public void TestIamPermissions() public async stt::Task TestIamPermissionsAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); TestIamPermissionsSnapshotRequest request = new TestIamPermissionsSnapshotRequest { Resource = "resource164eab96", diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/SslCertificatesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/SslCertificatesClientTest.g.cs index e3e6b1f523ea..faada57cc8db 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/SslCertificatesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/SslCertificatesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,188 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedSslCertificatesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSslCertificateRequest request = new DeleteSslCertificateRequest - { - RequestId = "request_id362c8df6", - SslCertificate = "ssl_certificate25650c52", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - SslCertificatesClient client = new SslCertificatesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSslCertificateRequest request = new DeleteSslCertificateRequest - { - RequestId = "request_id362c8df6", - SslCertificate = "ssl_certificate25650c52", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SslCertificatesClient client = new SslCertificatesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSslCertificateRequest request = new DeleteSslCertificateRequest - { - SslCertificate = "ssl_certificate25650c52", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - SslCertificatesClient client = new SslCertificatesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.SslCertificate); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSslCertificateRequest request = new DeleteSslCertificateRequest - { - SslCertificate = "ssl_certificate25650c52", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SslCertificatesClient client = new SslCertificatesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.SslCertificate, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.SslCertificate, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetSslCertificateRequest request = new GetSslCertificateRequest { SslCertificate = "ssl_certificate25650c52", @@ -244,6 +68,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetSslCertificateRequest request = new GetSslCertificateRequest { SslCertificate = "ssl_certificate25650c52", @@ -282,6 +107,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetSslCertificateRequest request = new GetSslCertificateRequest { SslCertificate = "ssl_certificate25650c52", @@ -318,6 +144,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetSslCertificateRequest request = new GetSslCertificateRequest { SslCertificate = "ssl_certificate25650c52", @@ -351,183 +178,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertSslCertificateRequest request = new InsertSslCertificateRequest - { - RequestId = "request_id362c8df6", - SslCertificateResource = new SslCertificate(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - SslCertificatesClient client = new SslCertificatesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertSslCertificateRequest request = new InsertSslCertificateRequest - { - RequestId = "request_id362c8df6", - SslCertificateResource = new SslCertificate(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SslCertificatesClient client = new SslCertificatesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertSslCertificateRequest request = new InsertSslCertificateRequest - { - SslCertificateResource = new SslCertificate(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - SslCertificatesClient client = new SslCertificatesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.SslCertificateResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertSslCertificateRequest request = new InsertSslCertificateRequest - { - SslCertificateResource = new SslCertificate(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SslCertificatesClient client = new SslCertificatesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.SslCertificateResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.SslCertificateResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/SslPoliciesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/SslPoliciesClientTest.g.cs index 66a99aca81b3..fbbbd618d31b 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/SslPoliciesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/SslPoliciesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,188 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedSslPoliciesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSslPolicyRequest request = new DeleteSslPolicyRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - SslPolicy = "ssl_policybf005a65", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - SslPoliciesClient client = new SslPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSslPolicyRequest request = new DeleteSslPolicyRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - SslPolicy = "ssl_policybf005a65", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SslPoliciesClient client = new SslPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSslPolicyRequest request = new DeleteSslPolicyRequest - { - Project = "projectaa6ff846", - SslPolicy = "ssl_policybf005a65", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - SslPoliciesClient client = new SslPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.SslPolicy); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSslPolicyRequest request = new DeleteSslPolicyRequest - { - Project = "projectaa6ff846", - SslPolicy = "ssl_policybf005a65", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SslPoliciesClient client = new SslPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.SslPolicy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.SslPolicy, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetSslPolicyRequest request = new GetSslPolicyRequest { Project = "projectaa6ff846", @@ -245,6 +69,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetSslPolicyRequest request = new GetSslPolicyRequest { Project = "projectaa6ff846", @@ -284,6 +109,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetSslPolicyRequest request = new GetSslPolicyRequest { Project = "projectaa6ff846", @@ -321,6 +147,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetSslPolicyRequest request = new GetSslPolicyRequest { Project = "projectaa6ff846", @@ -356,188 +183,11 @@ public void Get() mockGrpcClient.VerifyAll(); } - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertSslPolicyRequest request = new InsertSslPolicyRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - SslPolicyResource = new SslPolicy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - SslPoliciesClient client = new SslPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertSslPolicyRequest request = new InsertSslPolicyRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - SslPolicyResource = new SslPolicy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SslPoliciesClient client = new SslPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertSslPolicyRequest request = new InsertSslPolicyRequest - { - Project = "projectaa6ff846", - SslPolicyResource = new SslPolicy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - SslPoliciesClient client = new SslPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.SslPolicyResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertSslPolicyRequest request = new InsertSslPolicyRequest - { - Project = "projectaa6ff846", - SslPolicyResource = new SslPolicy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SslPoliciesClient client = new SslPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.SslPolicyResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.SslPolicyResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void ListAvailableFeaturesRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); ListAvailableFeaturesSslPoliciesRequest request = new ListAvailableFeaturesSslPoliciesRequest { PageToken = "page_tokenf09e5538", @@ -565,6 +215,7 @@ public void ListAvailableFeaturesRequestObject() public async stt::Task ListAvailableFeaturesRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); ListAvailableFeaturesSslPoliciesRequest request = new ListAvailableFeaturesSslPoliciesRequest { PageToken = "page_tokenf09e5538", @@ -594,6 +245,7 @@ public void ListAvailableFeaturesRequestObject() public void ListAvailableFeatures() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); ListAvailableFeaturesSslPoliciesRequest request = new ListAvailableFeaturesSslPoliciesRequest { Project = "projectaa6ff846", @@ -616,6 +268,7 @@ public void ListAvailableFeatures() public async stt::Task ListAvailableFeaturesAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); ListAvailableFeaturesSslPoliciesRequest request = new ListAvailableFeaturesSslPoliciesRequest { Project = "projectaa6ff846", @@ -635,187 +288,5 @@ public void ListAvailableFeatures() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchSslPolicyRequest request = new PatchSslPolicyRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - SslPolicyResource = new SslPolicy(), - SslPolicy = "ssl_policybf005a65", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - SslPoliciesClient client = new SslPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchSslPolicyRequest request = new PatchSslPolicyRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - SslPolicyResource = new SslPolicy(), - SslPolicy = "ssl_policybf005a65", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SslPoliciesClient client = new SslPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchSslPolicyRequest request = new PatchSslPolicyRequest - { - Project = "projectaa6ff846", - SslPolicyResource = new SslPolicy(), - SslPolicy = "ssl_policybf005a65", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - SslPoliciesClient client = new SslPoliciesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.SslPolicy, request.SslPolicyResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchSslPolicyRequest request = new PatchSslPolicyRequest - { - Project = "projectaa6ff846", - SslPolicyResource = new SslPolicy(), - SslPolicy = "ssl_policybf005a65", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SslPoliciesClient client = new SslPoliciesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.SslPolicy, request.SslPolicyResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.SslPolicy, request.SslPolicyResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/SubnetworksClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/SubnetworksClientTest.g.cs index 5d6d70c27537..8b7496738a40 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/SubnetworksClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/SubnetworksClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,378 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedSubnetworksClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSubnetworkRequest request = new DeleteSubnetworkRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - Subnetwork = "subnetworkf55bf572", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - SubnetworksClient client = new SubnetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSubnetworkRequest request = new DeleteSubnetworkRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - Subnetwork = "subnetworkf55bf572", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SubnetworksClient client = new SubnetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSubnetworkRequest request = new DeleteSubnetworkRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - Subnetwork = "subnetworkf55bf572", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - SubnetworksClient client = new SubnetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.Subnetwork); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteSubnetworkRequest request = new DeleteSubnetworkRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - Subnetwork = "subnetworkf55bf572", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SubnetworksClient client = new SubnetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.Subnetwork, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.Subnetwork, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void ExpandIpCidrRangeRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ExpandIpCidrRangeSubnetworkRequest request = new ExpandIpCidrRangeSubnetworkRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - Subnetwork = "subnetworkf55bf572", - SubnetworksExpandIpCidrRangeRequestResource = new SubnetworksExpandIpCidrRangeRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.ExpandIpCidrRange(request, moq::It.IsAny())).Returns(expectedResponse); - SubnetworksClient client = new SubnetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.ExpandIpCidrRange(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task ExpandIpCidrRangeRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ExpandIpCidrRangeSubnetworkRequest request = new ExpandIpCidrRangeSubnetworkRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - Subnetwork = "subnetworkf55bf572", - SubnetworksExpandIpCidrRangeRequestResource = new SubnetworksExpandIpCidrRangeRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.ExpandIpCidrRangeAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SubnetworksClient client = new SubnetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.ExpandIpCidrRangeAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.ExpandIpCidrRangeAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void ExpandIpCidrRange() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ExpandIpCidrRangeSubnetworkRequest request = new ExpandIpCidrRangeSubnetworkRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - Subnetwork = "subnetworkf55bf572", - SubnetworksExpandIpCidrRangeRequestResource = new SubnetworksExpandIpCidrRangeRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.ExpandIpCidrRange(request, moq::It.IsAny())).Returns(expectedResponse); - SubnetworksClient client = new SubnetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.ExpandIpCidrRange(request.Project, request.Region, request.Subnetwork, request.SubnetworksExpandIpCidrRangeRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task ExpandIpCidrRangeAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - ExpandIpCidrRangeSubnetworkRequest request = new ExpandIpCidrRangeSubnetworkRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - Subnetwork = "subnetworkf55bf572", - SubnetworksExpandIpCidrRangeRequestResource = new SubnetworksExpandIpCidrRangeRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.ExpandIpCidrRangeAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SubnetworksClient client = new SubnetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.ExpandIpCidrRangeAsync(request.Project, request.Region, request.Subnetwork, request.SubnetworksExpandIpCidrRangeRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.ExpandIpCidrRangeAsync(request.Project, request.Region, request.Subnetwork, request.SubnetworksExpandIpCidrRangeRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetSubnetworkRequest request = new GetSubnetworkRequest { Region = "regionedb20d96", @@ -441,6 +75,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetSubnetworkRequest request = new GetSubnetworkRequest { Region = "regionedb20d96", @@ -486,6 +121,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetSubnetworkRequest request = new GetSubnetworkRequest { Region = "regionedb20d96", @@ -529,6 +165,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetSubnetworkRequest request = new GetSubnetworkRequest { Region = "regionedb20d96", @@ -574,6 +211,7 @@ public void Get() public void GetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetIamPolicySubnetworkRequest request = new GetIamPolicySubnetworkRequest { Region = "regionedb20d96", @@ -601,6 +239,7 @@ public void GetIamPolicyRequestObject() public async stt::Task GetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetIamPolicySubnetworkRequest request = new GetIamPolicySubnetworkRequest { Region = "regionedb20d96", @@ -630,6 +269,7 @@ public void GetIamPolicyRequestObject() public void GetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetIamPolicySubnetworkRequest request = new GetIamPolicySubnetworkRequest { Region = "regionedb20d96", @@ -656,6 +296,7 @@ public void GetIamPolicy() public async stt::Task GetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetIamPolicySubnetworkRequest request = new GetIamPolicySubnetworkRequest { Region = "regionedb20d96", @@ -680,380 +321,11 @@ public void GetIamPolicy() mockGrpcClient.VerifyAll(); } - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertSubnetworkRequest request = new InsertSubnetworkRequest - { - RequestId = "request_id362c8df6", - SubnetworkResource = new Subnetwork(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - SubnetworksClient client = new SubnetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertSubnetworkRequest request = new InsertSubnetworkRequest - { - RequestId = "request_id362c8df6", - SubnetworkResource = new Subnetwork(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SubnetworksClient client = new SubnetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertSubnetworkRequest request = new InsertSubnetworkRequest - { - SubnetworkResource = new Subnetwork(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - SubnetworksClient client = new SubnetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.SubnetworkResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertSubnetworkRequest request = new InsertSubnetworkRequest - { - SubnetworkResource = new Subnetwork(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SubnetworksClient client = new SubnetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.SubnetworkResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.SubnetworkResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchSubnetworkRequest request = new PatchSubnetworkRequest - { - RequestId = "request_id362c8df6", - SubnetworkResource = new Subnetwork(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - Subnetwork = "subnetworkf55bf572", - DrainTimeoutSeconds = -72030427, - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - SubnetworksClient client = new SubnetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchSubnetworkRequest request = new PatchSubnetworkRequest - { - RequestId = "request_id362c8df6", - SubnetworkResource = new Subnetwork(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - Subnetwork = "subnetworkf55bf572", - DrainTimeoutSeconds = -72030427, - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SubnetworksClient client = new SubnetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchSubnetworkRequest request = new PatchSubnetworkRequest - { - SubnetworkResource = new Subnetwork(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - Subnetwork = "subnetworkf55bf572", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - SubnetworksClient client = new SubnetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.Region, request.Subnetwork, request.SubnetworkResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchSubnetworkRequest request = new PatchSubnetworkRequest - { - SubnetworkResource = new Subnetwork(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - Subnetwork = "subnetworkf55bf572", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SubnetworksClient client = new SubnetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.Region, request.Subnetwork, request.SubnetworkResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.Region, request.Subnetwork, request.SubnetworkResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void SetIamPolicyRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); SetIamPolicySubnetworkRequest request = new SetIamPolicySubnetworkRequest { Region = "regionedb20d96", @@ -1081,6 +353,7 @@ public void SetIamPolicyRequestObject() public async stt::Task SetIamPolicyRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); SetIamPolicySubnetworkRequest request = new SetIamPolicySubnetworkRequest { Region = "regionedb20d96", @@ -1110,6 +383,7 @@ public void SetIamPolicyRequestObject() public void SetIamPolicy() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); SetIamPolicySubnetworkRequest request = new SetIamPolicySubnetworkRequest { Region = "regionedb20d96", @@ -1137,6 +411,7 @@ public void SetIamPolicy() public async stt::Task SetIamPolicyAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); SetIamPolicySubnetworkRequest request = new SetIamPolicySubnetworkRequest { Region = "regionedb20d96", @@ -1162,196 +437,11 @@ public void SetIamPolicy() mockGrpcClient.VerifyAll(); } - [xunit::FactAttribute] - public void SetPrivateIpGoogleAccessRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetPrivateIpGoogleAccessSubnetworkRequest request = new SetPrivateIpGoogleAccessSubnetworkRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - SubnetworksSetPrivateIpGoogleAccessRequestResource = new SubnetworksSetPrivateIpGoogleAccessRequest(), - Subnetwork = "subnetworkf55bf572", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetPrivateIpGoogleAccess(request, moq::It.IsAny())).Returns(expectedResponse); - SubnetworksClient client = new SubnetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetPrivateIpGoogleAccess(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetPrivateIpGoogleAccessRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetPrivateIpGoogleAccessSubnetworkRequest request = new SetPrivateIpGoogleAccessSubnetworkRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - SubnetworksSetPrivateIpGoogleAccessRequestResource = new SubnetworksSetPrivateIpGoogleAccessRequest(), - Subnetwork = "subnetworkf55bf572", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetPrivateIpGoogleAccessAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SubnetworksClient client = new SubnetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetPrivateIpGoogleAccessAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetPrivateIpGoogleAccessAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetPrivateIpGoogleAccess() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetPrivateIpGoogleAccessSubnetworkRequest request = new SetPrivateIpGoogleAccessSubnetworkRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - SubnetworksSetPrivateIpGoogleAccessRequestResource = new SubnetworksSetPrivateIpGoogleAccessRequest(), - Subnetwork = "subnetworkf55bf572", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetPrivateIpGoogleAccess(request, moq::It.IsAny())).Returns(expectedResponse); - SubnetworksClient client = new SubnetworksClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetPrivateIpGoogleAccess(request.Project, request.Region, request.Subnetwork, request.SubnetworksSetPrivateIpGoogleAccessRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetPrivateIpGoogleAccessAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetPrivateIpGoogleAccessSubnetworkRequest request = new SetPrivateIpGoogleAccessSubnetworkRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - SubnetworksSetPrivateIpGoogleAccessRequestResource = new SubnetworksSetPrivateIpGoogleAccessRequest(), - Subnetwork = "subnetworkf55bf572", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetPrivateIpGoogleAccessAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - SubnetworksClient client = new SubnetworksClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetPrivateIpGoogleAccessAsync(request.Project, request.Region, request.Subnetwork, request.SubnetworksSetPrivateIpGoogleAccessRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetPrivateIpGoogleAccessAsync(request.Project, request.Region, request.Subnetwork, request.SubnetworksSetPrivateIpGoogleAccessRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void TestIamPermissionsRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsSubnetworkRequest request = new TestIamPermissionsSubnetworkRequest { Region = "regionedb20d96", @@ -1377,6 +467,7 @@ public void TestIamPermissionsRequestObject() public async stt::Task TestIamPermissionsRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsSubnetworkRequest request = new TestIamPermissionsSubnetworkRequest { Region = "regionedb20d96", @@ -1404,6 +495,7 @@ public void TestIamPermissionsRequestObject() public void TestIamPermissions() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsSubnetworkRequest request = new TestIamPermissionsSubnetworkRequest { Region = "regionedb20d96", @@ -1429,6 +521,7 @@ public void TestIamPermissions() public async stt::Task TestIamPermissionsAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsSubnetworkRequest request = new TestIamPermissionsSubnetworkRequest { Region = "regionedb20d96", diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetGrpcProxiesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetGrpcProxiesClientTest.g.cs index b33f042c9443..8e307be1f564 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetGrpcProxiesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetGrpcProxiesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,188 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedTargetGrpcProxiesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetGrpcProxyRequest request = new DeleteTargetGrpcProxyRequest - { - TargetGrpcProxy = "target_grpc_proxy51252bbb", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - TargetGrpcProxiesClient client = new TargetGrpcProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetGrpcProxyRequest request = new DeleteTargetGrpcProxyRequest - { - TargetGrpcProxy = "target_grpc_proxy51252bbb", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetGrpcProxiesClient client = new TargetGrpcProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetGrpcProxyRequest request = new DeleteTargetGrpcProxyRequest - { - TargetGrpcProxy = "target_grpc_proxy51252bbb", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - TargetGrpcProxiesClient client = new TargetGrpcProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.TargetGrpcProxy); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetGrpcProxyRequest request = new DeleteTargetGrpcProxyRequest - { - TargetGrpcProxy = "target_grpc_proxy51252bbb", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetGrpcProxiesClient client = new TargetGrpcProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.TargetGrpcProxy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.TargetGrpcProxy, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetTargetGrpcProxyRequest request = new GetTargetGrpcProxyRequest { TargetGrpcProxy = "target_grpc_proxy51252bbb", @@ -237,6 +61,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetTargetGrpcProxyRequest request = new GetTargetGrpcProxyRequest { TargetGrpcProxy = "target_grpc_proxy51252bbb", @@ -268,6 +93,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetTargetGrpcProxyRequest request = new GetTargetGrpcProxyRequest { TargetGrpcProxy = "target_grpc_proxy51252bbb", @@ -297,6 +123,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetTargetGrpcProxyRequest request = new GetTargetGrpcProxyRequest { TargetGrpcProxy = "target_grpc_proxy51252bbb", @@ -323,365 +150,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetGrpcProxyRequest request = new InsertTargetGrpcProxyRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - TargetGrpcProxyResource = new TargetGrpcProxy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - TargetGrpcProxiesClient client = new TargetGrpcProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetGrpcProxyRequest request = new InsertTargetGrpcProxyRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - TargetGrpcProxyResource = new TargetGrpcProxy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetGrpcProxiesClient client = new TargetGrpcProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetGrpcProxyRequest request = new InsertTargetGrpcProxyRequest - { - Project = "projectaa6ff846", - TargetGrpcProxyResource = new TargetGrpcProxy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - TargetGrpcProxiesClient client = new TargetGrpcProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.TargetGrpcProxyResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetGrpcProxyRequest request = new InsertTargetGrpcProxyRequest - { - Project = "projectaa6ff846", - TargetGrpcProxyResource = new TargetGrpcProxy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetGrpcProxiesClient client = new TargetGrpcProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.TargetGrpcProxyResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.TargetGrpcProxyResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchTargetGrpcProxyRequest request = new PatchTargetGrpcProxyRequest - { - TargetGrpcProxy = "target_grpc_proxy51252bbb", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - TargetGrpcProxyResource = new TargetGrpcProxy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - TargetGrpcProxiesClient client = new TargetGrpcProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchTargetGrpcProxyRequest request = new PatchTargetGrpcProxyRequest - { - TargetGrpcProxy = "target_grpc_proxy51252bbb", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - TargetGrpcProxyResource = new TargetGrpcProxy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetGrpcProxiesClient client = new TargetGrpcProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchTargetGrpcProxyRequest request = new PatchTargetGrpcProxyRequest - { - TargetGrpcProxy = "target_grpc_proxy51252bbb", - Project = "projectaa6ff846", - TargetGrpcProxyResource = new TargetGrpcProxy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - TargetGrpcProxiesClient client = new TargetGrpcProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.TargetGrpcProxy, request.TargetGrpcProxyResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchTargetGrpcProxyRequest request = new PatchTargetGrpcProxyRequest - { - TargetGrpcProxy = "target_grpc_proxy51252bbb", - Project = "projectaa6ff846", - TargetGrpcProxyResource = new TargetGrpcProxy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetGrpcProxiesClient client = new TargetGrpcProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.TargetGrpcProxy, request.TargetGrpcProxyResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.TargetGrpcProxy, request.TargetGrpcProxyResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetHttpProxiesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetHttpProxiesClientTest.g.cs index 81c68168b4ca..c1980003da6d 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetHttpProxiesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetHttpProxiesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,188 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedTargetHttpProxiesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetHttpProxyRequest request = new DeleteTargetHttpProxyRequest - { - RequestId = "request_id362c8df6", - TargetHttpProxy = "target_http_proxy02d2fd7b", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - TargetHttpProxiesClient client = new TargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetHttpProxyRequest request = new DeleteTargetHttpProxyRequest - { - RequestId = "request_id362c8df6", - TargetHttpProxy = "target_http_proxy02d2fd7b", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetHttpProxiesClient client = new TargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetHttpProxyRequest request = new DeleteTargetHttpProxyRequest - { - TargetHttpProxy = "target_http_proxy02d2fd7b", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - TargetHttpProxiesClient client = new TargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.TargetHttpProxy); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetHttpProxyRequest request = new DeleteTargetHttpProxyRequest - { - TargetHttpProxy = "target_http_proxy02d2fd7b", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetHttpProxiesClient client = new TargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.TargetHttpProxy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.TargetHttpProxy, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetTargetHttpProxyRequest request = new GetTargetHttpProxyRequest { TargetHttpProxy = "target_http_proxy02d2fd7b", @@ -237,6 +61,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetTargetHttpProxyRequest request = new GetTargetHttpProxyRequest { TargetHttpProxy = "target_http_proxy02d2fd7b", @@ -268,6 +93,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetTargetHttpProxyRequest request = new GetTargetHttpProxyRequest { TargetHttpProxy = "target_http_proxy02d2fd7b", @@ -297,6 +123,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetTargetHttpProxyRequest request = new GetTargetHttpProxyRequest { TargetHttpProxy = "target_http_proxy02d2fd7b", @@ -323,547 +150,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetHttpProxyRequest request = new InsertTargetHttpProxyRequest - { - TargetHttpProxyResource = new TargetHttpProxy(), - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - TargetHttpProxiesClient client = new TargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetHttpProxyRequest request = new InsertTargetHttpProxyRequest - { - TargetHttpProxyResource = new TargetHttpProxy(), - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetHttpProxiesClient client = new TargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetHttpProxyRequest request = new InsertTargetHttpProxyRequest - { - TargetHttpProxyResource = new TargetHttpProxy(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - TargetHttpProxiesClient client = new TargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.TargetHttpProxyResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetHttpProxyRequest request = new InsertTargetHttpProxyRequest - { - TargetHttpProxyResource = new TargetHttpProxy(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetHttpProxiesClient client = new TargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.TargetHttpProxyResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.TargetHttpProxyResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchTargetHttpProxyRequest request = new PatchTargetHttpProxyRequest - { - TargetHttpProxyResource = new TargetHttpProxy(), - RequestId = "request_id362c8df6", - TargetHttpProxy = "target_http_proxy02d2fd7b", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - TargetHttpProxiesClient client = new TargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchTargetHttpProxyRequest request = new PatchTargetHttpProxyRequest - { - TargetHttpProxyResource = new TargetHttpProxy(), - RequestId = "request_id362c8df6", - TargetHttpProxy = "target_http_proxy02d2fd7b", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetHttpProxiesClient client = new TargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchTargetHttpProxyRequest request = new PatchTargetHttpProxyRequest - { - TargetHttpProxyResource = new TargetHttpProxy(), - TargetHttpProxy = "target_http_proxy02d2fd7b", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - TargetHttpProxiesClient client = new TargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.TargetHttpProxy, request.TargetHttpProxyResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchTargetHttpProxyRequest request = new PatchTargetHttpProxyRequest - { - TargetHttpProxyResource = new TargetHttpProxy(), - TargetHttpProxy = "target_http_proxy02d2fd7b", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetHttpProxiesClient client = new TargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.TargetHttpProxy, request.TargetHttpProxyResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.TargetHttpProxy, request.TargetHttpProxyResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetUrlMapRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetUrlMapTargetHttpProxyRequest request = new SetUrlMapTargetHttpProxyRequest - { - RequestId = "request_id362c8df6", - TargetHttpProxy = "target_http_proxy02d2fd7b", - Project = "projectaa6ff846", - UrlMapReferenceResource = new UrlMapReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetUrlMap(request, moq::It.IsAny())).Returns(expectedResponse); - TargetHttpProxiesClient client = new TargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetUrlMap(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetUrlMapRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetUrlMapTargetHttpProxyRequest request = new SetUrlMapTargetHttpProxyRequest - { - RequestId = "request_id362c8df6", - TargetHttpProxy = "target_http_proxy02d2fd7b", - Project = "projectaa6ff846", - UrlMapReferenceResource = new UrlMapReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetUrlMapAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetHttpProxiesClient client = new TargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetUrlMapAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetUrlMapAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetUrlMap() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetUrlMapTargetHttpProxyRequest request = new SetUrlMapTargetHttpProxyRequest - { - TargetHttpProxy = "target_http_proxy02d2fd7b", - Project = "projectaa6ff846", - UrlMapReferenceResource = new UrlMapReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetUrlMap(request, moq::It.IsAny())).Returns(expectedResponse); - TargetHttpProxiesClient client = new TargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetUrlMap(request.Project, request.TargetHttpProxy, request.UrlMapReferenceResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetUrlMapAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetUrlMapTargetHttpProxyRequest request = new SetUrlMapTargetHttpProxyRequest - { - TargetHttpProxy = "target_http_proxy02d2fd7b", - Project = "projectaa6ff846", - UrlMapReferenceResource = new UrlMapReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetUrlMapAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetHttpProxiesClient client = new TargetHttpProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetUrlMapAsync(request.Project, request.TargetHttpProxy, request.UrlMapReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetUrlMapAsync(request.Project, request.TargetHttpProxy, request.UrlMapReferenceResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetHttpsProxiesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetHttpsProxiesClientTest.g.cs index 4374f972d11c..1f5042685f1c 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetHttpsProxiesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetHttpsProxiesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,188 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedTargetHttpsProxiesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetHttpsProxyRequest request = new DeleteTargetHttpsProxyRequest - { - RequestId = "request_id362c8df6", - TargetHttpsProxy = "target_https_proxycf436352", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetHttpsProxyRequest request = new DeleteTargetHttpsProxyRequest - { - RequestId = "request_id362c8df6", - TargetHttpsProxy = "target_https_proxycf436352", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetHttpsProxyRequest request = new DeleteTargetHttpsProxyRequest - { - TargetHttpsProxy = "target_https_proxycf436352", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.TargetHttpsProxy); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetHttpsProxyRequest request = new DeleteTargetHttpsProxyRequest - { - TargetHttpsProxy = "target_https_proxycf436352", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.TargetHttpsProxy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.TargetHttpsProxy, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetTargetHttpsProxyRequest request = new GetTargetHttpsProxyRequest { TargetHttpsProxy = "target_https_proxycf436352", @@ -245,6 +69,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetTargetHttpsProxyRequest request = new GetTargetHttpsProxyRequest { TargetHttpsProxy = "target_https_proxycf436352", @@ -284,6 +109,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetTargetHttpsProxyRequest request = new GetTargetHttpsProxyRequest { TargetHttpsProxy = "target_https_proxycf436352", @@ -321,6 +147,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetTargetHttpsProxyRequest request = new GetTargetHttpsProxyRequest { TargetHttpsProxy = "target_https_proxycf436352", @@ -355,1093 +182,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetHttpsProxyRequest request = new InsertTargetHttpsProxyRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - TargetHttpsProxyResource = new TargetHttpsProxy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetHttpsProxyRequest request = new InsertTargetHttpsProxyRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - TargetHttpsProxyResource = new TargetHttpsProxy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetHttpsProxyRequest request = new InsertTargetHttpsProxyRequest - { - Project = "projectaa6ff846", - TargetHttpsProxyResource = new TargetHttpsProxy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.TargetHttpsProxyResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetHttpsProxyRequest request = new InsertTargetHttpsProxyRequest - { - Project = "projectaa6ff846", - TargetHttpsProxyResource = new TargetHttpsProxy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.TargetHttpsProxyResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.TargetHttpsProxyResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchTargetHttpsProxyRequest request = new PatchTargetHttpsProxyRequest - { - RequestId = "request_id362c8df6", - TargetHttpsProxy = "target_https_proxycf436352", - Project = "projectaa6ff846", - TargetHttpsProxyResource = new TargetHttpsProxy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchTargetHttpsProxyRequest request = new PatchTargetHttpsProxyRequest - { - RequestId = "request_id362c8df6", - TargetHttpsProxy = "target_https_proxycf436352", - Project = "projectaa6ff846", - TargetHttpsProxyResource = new TargetHttpsProxy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchTargetHttpsProxyRequest request = new PatchTargetHttpsProxyRequest - { - TargetHttpsProxy = "target_https_proxycf436352", - Project = "projectaa6ff846", - TargetHttpsProxyResource = new TargetHttpsProxy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.TargetHttpsProxy, request.TargetHttpsProxyResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchTargetHttpsProxyRequest request = new PatchTargetHttpsProxyRequest - { - TargetHttpsProxy = "target_https_proxycf436352", - Project = "projectaa6ff846", - TargetHttpsProxyResource = new TargetHttpsProxy(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.TargetHttpsProxy, request.TargetHttpsProxyResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.TargetHttpsProxy, request.TargetHttpsProxyResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetQuicOverrideRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetQuicOverrideTargetHttpsProxyRequest request = new SetQuicOverrideTargetHttpsProxyRequest - { - RequestId = "request_id362c8df6", - TargetHttpsProxy = "target_https_proxycf436352", - TargetHttpsProxiesSetQuicOverrideRequestResource = new TargetHttpsProxiesSetQuicOverrideRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetQuicOverride(request, moq::It.IsAny())).Returns(expectedResponse); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetQuicOverride(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetQuicOverrideRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetQuicOverrideTargetHttpsProxyRequest request = new SetQuicOverrideTargetHttpsProxyRequest - { - RequestId = "request_id362c8df6", - TargetHttpsProxy = "target_https_proxycf436352", - TargetHttpsProxiesSetQuicOverrideRequestResource = new TargetHttpsProxiesSetQuicOverrideRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetQuicOverrideAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetQuicOverrideAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetQuicOverrideAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetQuicOverride() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetQuicOverrideTargetHttpsProxyRequest request = new SetQuicOverrideTargetHttpsProxyRequest - { - TargetHttpsProxy = "target_https_proxycf436352", - TargetHttpsProxiesSetQuicOverrideRequestResource = new TargetHttpsProxiesSetQuicOverrideRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetQuicOverride(request, moq::It.IsAny())).Returns(expectedResponse); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetQuicOverride(request.Project, request.TargetHttpsProxy, request.TargetHttpsProxiesSetQuicOverrideRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetQuicOverrideAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetQuicOverrideTargetHttpsProxyRequest request = new SetQuicOverrideTargetHttpsProxyRequest - { - TargetHttpsProxy = "target_https_proxycf436352", - TargetHttpsProxiesSetQuicOverrideRequestResource = new TargetHttpsProxiesSetQuicOverrideRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetQuicOverrideAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetQuicOverrideAsync(request.Project, request.TargetHttpsProxy, request.TargetHttpsProxiesSetQuicOverrideRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetQuicOverrideAsync(request.Project, request.TargetHttpsProxy, request.TargetHttpsProxiesSetQuicOverrideRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetSslCertificatesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSslCertificatesTargetHttpsProxyRequest request = new SetSslCertificatesTargetHttpsProxyRequest - { - RequestId = "request_id362c8df6", - TargetHttpsProxy = "target_https_proxycf436352", - TargetHttpsProxiesSetSslCertificatesRequestResource = new TargetHttpsProxiesSetSslCertificatesRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetSslCertificates(request, moq::It.IsAny())).Returns(expectedResponse); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetSslCertificates(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetSslCertificatesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSslCertificatesTargetHttpsProxyRequest request = new SetSslCertificatesTargetHttpsProxyRequest - { - RequestId = "request_id362c8df6", - TargetHttpsProxy = "target_https_proxycf436352", - TargetHttpsProxiesSetSslCertificatesRequestResource = new TargetHttpsProxiesSetSslCertificatesRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetSslCertificatesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetSslCertificatesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetSslCertificatesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetSslCertificates() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSslCertificatesTargetHttpsProxyRequest request = new SetSslCertificatesTargetHttpsProxyRequest - { - TargetHttpsProxy = "target_https_proxycf436352", - TargetHttpsProxiesSetSslCertificatesRequestResource = new TargetHttpsProxiesSetSslCertificatesRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetSslCertificates(request, moq::It.IsAny())).Returns(expectedResponse); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetSslCertificates(request.Project, request.TargetHttpsProxy, request.TargetHttpsProxiesSetSslCertificatesRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetSslCertificatesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSslCertificatesTargetHttpsProxyRequest request = new SetSslCertificatesTargetHttpsProxyRequest - { - TargetHttpsProxy = "target_https_proxycf436352", - TargetHttpsProxiesSetSslCertificatesRequestResource = new TargetHttpsProxiesSetSslCertificatesRequest(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetSslCertificatesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetSslCertificatesAsync(request.Project, request.TargetHttpsProxy, request.TargetHttpsProxiesSetSslCertificatesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetSslCertificatesAsync(request.Project, request.TargetHttpsProxy, request.TargetHttpsProxiesSetSslCertificatesRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetSslPolicyRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSslPolicyTargetHttpsProxyRequest request = new SetSslPolicyTargetHttpsProxyRequest - { - RequestId = "request_id362c8df6", - TargetHttpsProxy = "target_https_proxycf436352", - Project = "projectaa6ff846", - SslPolicyReferenceResource = new SslPolicyReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetSslPolicy(request, moq::It.IsAny())).Returns(expectedResponse); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetSslPolicy(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetSslPolicyRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSslPolicyTargetHttpsProxyRequest request = new SetSslPolicyTargetHttpsProxyRequest - { - RequestId = "request_id362c8df6", - TargetHttpsProxy = "target_https_proxycf436352", - Project = "projectaa6ff846", - SslPolicyReferenceResource = new SslPolicyReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetSslPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetSslPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetSslPolicyAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetSslPolicy() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSslPolicyTargetHttpsProxyRequest request = new SetSslPolicyTargetHttpsProxyRequest - { - TargetHttpsProxy = "target_https_proxycf436352", - Project = "projectaa6ff846", - SslPolicyReferenceResource = new SslPolicyReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetSslPolicy(request, moq::It.IsAny())).Returns(expectedResponse); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetSslPolicy(request.Project, request.TargetHttpsProxy, request.SslPolicyReferenceResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetSslPolicyAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSslPolicyTargetHttpsProxyRequest request = new SetSslPolicyTargetHttpsProxyRequest - { - TargetHttpsProxy = "target_https_proxycf436352", - Project = "projectaa6ff846", - SslPolicyReferenceResource = new SslPolicyReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetSslPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetSslPolicyAsync(request.Project, request.TargetHttpsProxy, request.SslPolicyReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetSslPolicyAsync(request.Project, request.TargetHttpsProxy, request.SslPolicyReferenceResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetUrlMapRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetUrlMapTargetHttpsProxyRequest request = new SetUrlMapTargetHttpsProxyRequest - { - RequestId = "request_id362c8df6", - TargetHttpsProxy = "target_https_proxycf436352", - Project = "projectaa6ff846", - UrlMapReferenceResource = new UrlMapReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetUrlMap(request, moq::It.IsAny())).Returns(expectedResponse); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetUrlMap(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetUrlMapRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetUrlMapTargetHttpsProxyRequest request = new SetUrlMapTargetHttpsProxyRequest - { - RequestId = "request_id362c8df6", - TargetHttpsProxy = "target_https_proxycf436352", - Project = "projectaa6ff846", - UrlMapReferenceResource = new UrlMapReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetUrlMapAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetUrlMapAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetUrlMapAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetUrlMap() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetUrlMapTargetHttpsProxyRequest request = new SetUrlMapTargetHttpsProxyRequest - { - TargetHttpsProxy = "target_https_proxycf436352", - Project = "projectaa6ff846", - UrlMapReferenceResource = new UrlMapReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetUrlMap(request, moq::It.IsAny())).Returns(expectedResponse); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetUrlMap(request.Project, request.TargetHttpsProxy, request.UrlMapReferenceResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetUrlMapAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetUrlMapTargetHttpsProxyRequest request = new SetUrlMapTargetHttpsProxyRequest - { - TargetHttpsProxy = "target_https_proxycf436352", - Project = "projectaa6ff846", - UrlMapReferenceResource = new UrlMapReference(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetUrlMapAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetHttpsProxiesClient client = new TargetHttpsProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetUrlMapAsync(request.Project, request.TargetHttpsProxy, request.UrlMapReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetUrlMapAsync(request.Project, request.TargetHttpsProxy, request.UrlMapReferenceResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetInstancesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetInstancesClientTest.g.cs index cb5ba35a19ce..525635a3d9db 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetInstancesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetInstancesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedTargetInstancesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetInstanceRequest request = new DeleteTargetInstanceRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - TargetInstance = "target_instance1017fe07", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - TargetInstancesClient client = new TargetInstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetInstanceRequest request = new DeleteTargetInstanceRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - TargetInstance = "target_instance1017fe07", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetInstancesClient client = new TargetInstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetInstanceRequest request = new DeleteTargetInstanceRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - TargetInstance = "target_instance1017fe07", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - TargetInstancesClient client = new TargetInstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Zone, request.TargetInstance); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetInstanceRequest request = new DeleteTargetInstanceRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - TargetInstance = "target_instance1017fe07", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetInstancesClient client = new TargetInstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Zone, request.TargetInstance, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Zone, request.TargetInstance, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetTargetInstanceRequest request = new GetTargetInstanceRequest { Zone = "zone255f4ea8", @@ -241,6 +61,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetTargetInstanceRequest request = new GetTargetInstanceRequest { Zone = "zone255f4ea8", @@ -272,6 +93,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetTargetInstanceRequest request = new GetTargetInstanceRequest { Zone = "zone255f4ea8", @@ -301,6 +123,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForZoneOperations()).Returns(new moq::Mock().Object); GetTargetInstanceRequest request = new GetTargetInstanceRequest { Zone = "zone255f4ea8", @@ -327,187 +150,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetInstanceRequest request = new InsertTargetInstanceRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - TargetInstanceResource = new TargetInstance(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - TargetInstancesClient client = new TargetInstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetInstanceRequest request = new InsertTargetInstanceRequest - { - Zone = "zone255f4ea8", - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - TargetInstanceResource = new TargetInstance(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetInstancesClient client = new TargetInstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetInstanceRequest request = new InsertTargetInstanceRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - TargetInstanceResource = new TargetInstance(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - TargetInstancesClient client = new TargetInstancesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Zone, request.TargetInstanceResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetInstanceRequest request = new InsertTargetInstanceRequest - { - Zone = "zone255f4ea8", - Project = "projectaa6ff846", - TargetInstanceResource = new TargetInstance(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetInstancesClient client = new TargetInstancesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Zone, request.TargetInstanceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Zone, request.TargetInstanceResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetPoolsClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetPoolsClientTest.g.cs index 01981f27bec1..bdd9c749f787 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetPoolsClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetPoolsClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -27,1549 +28,261 @@ namespace Google.Cloud.Compute.V1.Tests public sealed class GeneratedTargetPoolsClientTest { [xunit::FactAttribute] - public void AddHealthCheckRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddHealthCheckTargetPoolRequest request = new AddHealthCheckTargetPoolRequest - { - RequestId = "request_id362c8df6", - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - TargetPoolsAddHealthCheckRequestResource = new TargetPoolsAddHealthCheckRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddHealthCheck(request, moq::It.IsAny())).Returns(expectedResponse); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddHealthCheck(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddHealthCheckRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddHealthCheckTargetPoolRequest request = new AddHealthCheckTargetPoolRequest - { - RequestId = "request_id362c8df6", - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - TargetPoolsAddHealthCheckRequestResource = new TargetPoolsAddHealthCheckRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddHealthCheckAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddHealthCheckAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddHealthCheckAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void AddHealthCheck() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddHealthCheckTargetPoolRequest request = new AddHealthCheckTargetPoolRequest - { - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - TargetPoolsAddHealthCheckRequestResource = new TargetPoolsAddHealthCheckRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddHealthCheck(request, moq::It.IsAny())).Returns(expectedResponse); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddHealthCheck(request.Project, request.Region, request.TargetPool, request.TargetPoolsAddHealthCheckRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddHealthCheckAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddHealthCheckTargetPoolRequest request = new AddHealthCheckTargetPoolRequest - { - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - TargetPoolsAddHealthCheckRequestResource = new TargetPoolsAddHealthCheckRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddHealthCheckAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddHealthCheckAsync(request.Project, request.Region, request.TargetPool, request.TargetPoolsAddHealthCheckRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddHealthCheckAsync(request.Project, request.Region, request.TargetPool, request.TargetPoolsAddHealthCheckRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void AddInstanceRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddInstanceTargetPoolRequest request = new AddInstanceTargetPoolRequest - { - RequestId = "request_id362c8df6", - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - TargetPoolsAddInstanceRequestResource = new TargetPoolsAddInstanceRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddInstance(request, moq::It.IsAny())).Returns(expectedResponse); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddInstance(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddInstanceRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddInstanceTargetPoolRequest request = new AddInstanceTargetPoolRequest - { - RequestId = "request_id362c8df6", - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - TargetPoolsAddInstanceRequestResource = new TargetPoolsAddInstanceRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddInstanceAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddInstanceAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddInstanceAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void AddInstance() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddInstanceTargetPoolRequest request = new AddInstanceTargetPoolRequest - { - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - TargetPoolsAddInstanceRequestResource = new TargetPoolsAddInstanceRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddInstance(request, moq::It.IsAny())).Returns(expectedResponse); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation response = client.AddInstance(request.Project, request.Region, request.TargetPool, request.TargetPoolsAddInstanceRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task AddInstanceAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - AddInstanceTargetPoolRequest request = new AddInstanceTargetPoolRequest - { - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - TargetPoolsAddInstanceRequestResource = new TargetPoolsAddInstanceRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.AddInstanceAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.AddInstanceAsync(request.Project, request.Region, request.TargetPool, request.TargetPoolsAddInstanceRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.AddInstanceAsync(request.Project, request.Region, request.TargetPool, request.TargetPoolsAddInstanceRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetPoolRequest request = new DeleteTargetPoolRequest - { - RequestId = "request_id362c8df6", - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetPoolRequest request = new DeleteTargetPoolRequest - { - RequestId = "request_id362c8df6", - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetPoolRequest request = new DeleteTargetPoolRequest - { - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.TargetPool); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetPoolRequest request = new DeleteTargetPoolRequest - { - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.TargetPool, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.TargetPool, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetTargetPoolRequest request = new GetTargetPoolRequest - { - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - TargetPool expectedResponse = new TargetPool - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Instances = - { - "instances5432a96f", - }, - CreationTimestamp = "creation_timestamp235e59a1", - BackupPool = "backup_pool2446601c", - Region = "regionedb20d96", - FailoverRatio = -7.1869584E+17F, - Description = "description2cf9da67", - HealthChecks = - { - "health_checksedb1f3f8", - }, - SelfLink = "self_link7e87f12d", - SessionAffinity = TargetPool.Types.SessionAffinity.GeneratedCookie, - }; - mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - TargetPool response = client.Get(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetTargetPoolRequest request = new GetTargetPoolRequest - { - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - TargetPool expectedResponse = new TargetPool - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Instances = - { - "instances5432a96f", - }, - CreationTimestamp = "creation_timestamp235e59a1", - BackupPool = "backup_pool2446601c", - Region = "regionedb20d96", - FailoverRatio = -7.1869584E+17F, - Description = "description2cf9da67", - HealthChecks = - { - "health_checksedb1f3f8", - }, - SelfLink = "self_link7e87f12d", - SessionAffinity = TargetPool.Types.SessionAffinity.GeneratedCookie, - }; - mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - TargetPool responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - TargetPool responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Get() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetTargetPoolRequest request = new GetTargetPoolRequest - { - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - TargetPool expectedResponse = new TargetPool - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Instances = - { - "instances5432a96f", - }, - CreationTimestamp = "creation_timestamp235e59a1", - BackupPool = "backup_pool2446601c", - Region = "regionedb20d96", - FailoverRatio = -7.1869584E+17F, - Description = "description2cf9da67", - HealthChecks = - { - "health_checksedb1f3f8", - }, - SelfLink = "self_link7e87f12d", - SessionAffinity = TargetPool.Types.SessionAffinity.GeneratedCookie, - }; - mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - TargetPool response = client.Get(request.Project, request.Region, request.TargetPool); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetTargetPoolRequest request = new GetTargetPoolRequest - { - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - TargetPool expectedResponse = new TargetPool - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - Instances = - { - "instances5432a96f", - }, - CreationTimestamp = "creation_timestamp235e59a1", - BackupPool = "backup_pool2446601c", - Region = "regionedb20d96", - FailoverRatio = -7.1869584E+17F, - Description = "description2cf9da67", - HealthChecks = - { - "health_checksedb1f3f8", - }, - SelfLink = "self_link7e87f12d", - SessionAffinity = TargetPool.Types.SessionAffinity.GeneratedCookie, - }; - mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - TargetPool responseCallSettings = await client.GetAsync(request.Project, request.Region, request.TargetPool, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - TargetPool responseCancellationToken = await client.GetAsync(request.Project, request.Region, request.TargetPool, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetHealthRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetHealthTargetPoolRequest request = new GetHealthTargetPoolRequest - { - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceReferenceResource = new InstanceReference(), - }; - TargetPoolInstanceHealth expectedResponse = new TargetPoolInstanceHealth - { - Kind = "kindf7aa39d9", - HealthStatus = { new HealthStatus(), }, - }; - mockGrpcClient.Setup(x => x.GetHealth(request, moq::It.IsAny())).Returns(expectedResponse); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - TargetPoolInstanceHealth response = client.GetHealth(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetHealthRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetHealthTargetPoolRequest request = new GetHealthTargetPoolRequest - { - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceReferenceResource = new InstanceReference(), - }; - TargetPoolInstanceHealth expectedResponse = new TargetPoolInstanceHealth - { - Kind = "kindf7aa39d9", - HealthStatus = { new HealthStatus(), }, - }; - mockGrpcClient.Setup(x => x.GetHealthAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - TargetPoolInstanceHealth responseCallSettings = await client.GetHealthAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - TargetPoolInstanceHealth responseCancellationToken = await client.GetHealthAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void GetHealth() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetHealthTargetPoolRequest request = new GetHealthTargetPoolRequest - { - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceReferenceResource = new InstanceReference(), - }; - TargetPoolInstanceHealth expectedResponse = new TargetPoolInstanceHealth - { - Kind = "kindf7aa39d9", - HealthStatus = { new HealthStatus(), }, - }; - mockGrpcClient.Setup(x => x.GetHealth(request, moq::It.IsAny())).Returns(expectedResponse); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - TargetPoolInstanceHealth response = client.GetHealth(request.Project, request.Region, request.TargetPool, request.InstanceReferenceResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task GetHealthAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - GetHealthTargetPoolRequest request = new GetHealthTargetPoolRequest - { - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - InstanceReferenceResource = new InstanceReference(), - }; - TargetPoolInstanceHealth expectedResponse = new TargetPoolInstanceHealth - { - Kind = "kindf7aa39d9", - HealthStatus = { new HealthStatus(), }, - }; - mockGrpcClient.Setup(x => x.GetHealthAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - TargetPoolInstanceHealth responseCallSettings = await client.GetHealthAsync(request.Project, request.Region, request.TargetPool, request.InstanceReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - TargetPoolInstanceHealth responseCancellationToken = await client.GetHealthAsync(request.Project, request.Region, request.TargetPool, request.InstanceReferenceResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetPoolRequest request = new InsertTargetPoolRequest - { - RequestId = "request_id362c8df6", - TargetPoolResource = new TargetPool(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetPoolRequest request = new InsertTargetPoolRequest - { - RequestId = "request_id362c8df6", - TargetPoolResource = new TargetPool(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetPoolRequest request = new InsertTargetPoolRequest - { - TargetPoolResource = new TargetPool(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.TargetPoolResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetPoolRequest request = new InsertTargetPoolRequest - { - TargetPoolResource = new TargetPool(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.TargetPoolResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.TargetPoolResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void RemoveHealthCheckRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveHealthCheckTargetPoolRequest request = new RemoveHealthCheckTargetPoolRequest - { - RequestId = "request_id362c8df6", - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - TargetPoolsRemoveHealthCheckRequestResource = new TargetPoolsRemoveHealthCheckRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveHealthCheck(request, moq::It.IsAny())).Returns(expectedResponse); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation response = client.RemoveHealthCheck(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task RemoveHealthCheckRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveHealthCheckTargetPoolRequest request = new RemoveHealthCheckTargetPoolRequest - { - RequestId = "request_id362c8df6", - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - TargetPoolsRemoveHealthCheckRequestResource = new TargetPoolsRemoveHealthCheckRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveHealthCheckAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RemoveHealthCheckAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RemoveHealthCheckAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void RemoveHealthCheck() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveHealthCheckTargetPoolRequest request = new RemoveHealthCheckTargetPoolRequest - { - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - TargetPoolsRemoveHealthCheckRequestResource = new TargetPoolsRemoveHealthCheckRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveHealthCheck(request, moq::It.IsAny())).Returns(expectedResponse); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation response = client.RemoveHealthCheck(request.Project, request.Region, request.TargetPool, request.TargetPoolsRemoveHealthCheckRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task RemoveHealthCheckAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveHealthCheckTargetPoolRequest request = new RemoveHealthCheckTargetPoolRequest - { - TargetPool = "target_pool65e437ac", - Region = "regionedb20d96", - Project = "projectaa6ff846", - TargetPoolsRemoveHealthCheckRequestResource = new TargetPoolsRemoveHealthCheckRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.RemoveHealthCheckAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RemoveHealthCheckAsync(request.Project, request.Region, request.TargetPool, request.TargetPoolsRemoveHealthCheckRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RemoveHealthCheckAsync(request.Project, request.Region, request.TargetPool, request.TargetPoolsRemoveHealthCheckRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void RemoveInstanceRequestObject() + public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveInstanceTargetPoolRequest request = new RemoveInstanceTargetPoolRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + GetTargetPoolRequest request = new GetTargetPoolRequest { - TargetPoolsRemoveInstanceRequestResource = new TargetPoolsRemoveInstanceRequest(), - RequestId = "request_id362c8df6", TargetPool = "target_pool65e437ac", Region = "regionedb20d96", Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + TargetPool expectedResponse = new TargetPool { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", + Instances = + { + "instances5432a96f", + }, CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + BackupPool = "backup_pool2446601c", Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + FailoverRatio = -7.1869584E+17F, Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + HealthChecks = + { + "health_checksedb1f3f8", + }, SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + SessionAffinity = TargetPool.Types.SessionAffinity.GeneratedCookie, }; - mockGrpcClient.Setup(x => x.RemoveInstance(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation response = client.RemoveInstance(request); + TargetPool response = client.Get(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task RemoveInstanceRequestObjectAsync() + public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveInstanceTargetPoolRequest request = new RemoveInstanceTargetPoolRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + GetTargetPoolRequest request = new GetTargetPoolRequest { - TargetPoolsRemoveInstanceRequestResource = new TargetPoolsRemoveInstanceRequest(), - RequestId = "request_id362c8df6", TargetPool = "target_pool65e437ac", Region = "regionedb20d96", Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + TargetPool expectedResponse = new TargetPool { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", + Instances = + { + "instances5432a96f", + }, CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + BackupPool = "backup_pool2446601c", Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + FailoverRatio = -7.1869584E+17F, Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + HealthChecks = + { + "health_checksedb1f3f8", + }, SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + SessionAffinity = TargetPool.Types.SessionAffinity.GeneratedCookie, }; - mockGrpcClient.Setup(x => x.RemoveInstanceAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RemoveInstanceAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + TargetPool responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RemoveInstanceAsync(request, st::CancellationToken.None); + TargetPool responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void RemoveInstance() + public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveInstanceTargetPoolRequest request = new RemoveInstanceTargetPoolRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + GetTargetPoolRequest request = new GetTargetPoolRequest { - TargetPoolsRemoveInstanceRequestResource = new TargetPoolsRemoveInstanceRequest(), TargetPool = "target_pool65e437ac", Region = "regionedb20d96", Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + TargetPool expectedResponse = new TargetPool { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", + Instances = + { + "instances5432a96f", + }, CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + BackupPool = "backup_pool2446601c", Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + FailoverRatio = -7.1869584E+17F, Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + HealthChecks = + { + "health_checksedb1f3f8", + }, SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + SessionAffinity = TargetPool.Types.SessionAffinity.GeneratedCookie, }; - mockGrpcClient.Setup(x => x.RemoveInstance(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny())).Returns(expectedResponse); TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation response = client.RemoveInstance(request.Project, request.Region, request.TargetPool, request.TargetPoolsRemoveInstanceRequestResource); + TargetPool response = client.Get(request.Project, request.Region, request.TargetPool); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task RemoveInstanceAsync() + public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - RemoveInstanceTargetPoolRequest request = new RemoveInstanceTargetPoolRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + GetTargetPoolRequest request = new GetTargetPoolRequest { - TargetPoolsRemoveInstanceRequestResource = new TargetPoolsRemoveInstanceRequest(), TargetPool = "target_pool65e437ac", Region = "regionedb20d96", Project = "projectaa6ff846", }; - Operation expectedResponse = new Operation + TargetPool expectedResponse = new TargetPool { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", + Instances = + { + "instances5432a96f", + }, CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", + BackupPool = "backup_pool2446601c", Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, + FailoverRatio = -7.1869584E+17F, Description = "description2cf9da67", - InsertTime = "insert_time7467185a", + HealthChecks = + { + "health_checksedb1f3f8", + }, SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + SessionAffinity = TargetPool.Types.SessionAffinity.GeneratedCookie, }; - mockGrpcClient.Setup(x => x.RemoveInstanceAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.RemoveInstanceAsync(request.Project, request.Region, request.TargetPool, request.TargetPoolsRemoveInstanceRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + TargetPool responseCallSettings = await client.GetAsync(request.Project, request.Region, request.TargetPool, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.RemoveInstanceAsync(request.Project, request.Region, request.TargetPool, request.TargetPoolsRemoveInstanceRequestResource, st::CancellationToken.None); + TargetPool responseCancellationToken = await client.GetAsync(request.Project, request.Region, request.TargetPool, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void SetBackupRequestObject() + public void GetHealthRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetBackupTargetPoolRequest request = new SetBackupTargetPoolRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + GetHealthTargetPoolRequest request = new GetHealthTargetPoolRequest { - RequestId = "request_id362c8df6", TargetPool = "target_pool65e437ac", Region = "regionedb20d96", - FailoverRatio = -7.1869584E+17F, Project = "projectaa6ff846", - TargetReferenceResource = new TargetReference(), + InstanceReferenceResource = new InstanceReference(), }; - Operation expectedResponse = new Operation + TargetPoolInstanceHealth expectedResponse = new TargetPoolInstanceHealth { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + HealthStatus = { new HealthStatus(), }, }; - mockGrpcClient.Setup(x => x.SetBackup(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetHealth(request, moq::It.IsAny())).Returns(expectedResponse); TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetBackup(request); + TargetPoolInstanceHealth response = client.GetHealth(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task SetBackupRequestObjectAsync() + public async stt::Task GetHealthRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetBackupTargetPoolRequest request = new SetBackupTargetPoolRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + GetHealthTargetPoolRequest request = new GetHealthTargetPoolRequest { - RequestId = "request_id362c8df6", TargetPool = "target_pool65e437ac", Region = "regionedb20d96", - FailoverRatio = -7.1869584E+17F, Project = "projectaa6ff846", - TargetReferenceResource = new TargetReference(), + InstanceReferenceResource = new InstanceReference(), }; - Operation expectedResponse = new Operation + TargetPoolInstanceHealth expectedResponse = new TargetPoolInstanceHealth { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + HealthStatus = { new HealthStatus(), }, }; - mockGrpcClient.Setup(x => x.SetBackupAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetHealthAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetBackupAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + TargetPoolInstanceHealth responseCallSettings = await client.GetHealthAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetBackupAsync(request, st::CancellationToken.None); + TargetPoolInstanceHealth responseCancellationToken = await client.GetHealthAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public void SetBackup() + public void GetHealth() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetBackupTargetPoolRequest request = new SetBackupTargetPoolRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + GetHealthTargetPoolRequest request = new GetHealthTargetPoolRequest { TargetPool = "target_pool65e437ac", Region = "regionedb20d96", Project = "projectaa6ff846", - TargetReferenceResource = new TargetReference(), + InstanceReferenceResource = new InstanceReference(), }; - Operation expectedResponse = new Operation + TargetPoolInstanceHealth expectedResponse = new TargetPoolInstanceHealth { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + HealthStatus = { new HealthStatus(), }, }; - mockGrpcClient.Setup(x => x.SetBackup(request, moq::It.IsAny())).Returns(expectedResponse); + mockGrpcClient.Setup(x => x.GetHealth(request, moq::It.IsAny())).Returns(expectedResponse); TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetBackup(request.Project, request.Region, request.TargetPool, request.TargetReferenceResource); + TargetPoolInstanceHealth response = client.GetHealth(request.Project, request.Region, request.TargetPool, request.InstanceReferenceResource); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); } [xunit::FactAttribute] - public async stt::Task SetBackupAsync() + public async stt::Task GetHealthAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetBackupTargetPoolRequest request = new SetBackupTargetPoolRequest + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); + GetHealthTargetPoolRequest request = new GetHealthTargetPoolRequest { TargetPool = "target_pool65e437ac", Region = "regionedb20d96", Project = "projectaa6ff846", - TargetReferenceResource = new TargetReference(), + InstanceReferenceResource = new InstanceReference(), }; - Operation expectedResponse = new Operation + TargetPoolInstanceHealth expectedResponse = new TargetPoolInstanceHealth { - Id = 11672635353343658936UL, Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, + HealthStatus = { new HealthStatus(), }, }; - mockGrpcClient.Setup(x => x.SetBackupAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); + mockGrpcClient.Setup(x => x.GetHealthAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); TargetPoolsClient client = new TargetPoolsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetBackupAsync(request.Project, request.Region, request.TargetPool, request.TargetReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); + TargetPoolInstanceHealth responseCallSettings = await client.GetHealthAsync(request.Project, request.Region, request.TargetPool, request.InstanceReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetBackupAsync(request.Project, request.Region, request.TargetPool, request.TargetReferenceResource, st::CancellationToken.None); + TargetPoolInstanceHealth responseCancellationToken = await client.GetHealthAsync(request.Project, request.Region, request.TargetPool, request.InstanceReferenceResource, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetSslProxiesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetSslProxiesClientTest.g.cs index 8405bc511f50..3045b3c359a2 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetSslProxiesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetSslProxiesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,188 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedTargetSslProxiesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetSslProxyRequest request = new DeleteTargetSslProxyRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - TargetSslProxy = "target_ssl_proxy8c6691c6", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetSslProxyRequest request = new DeleteTargetSslProxyRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - TargetSslProxy = "target_ssl_proxy8c6691c6", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetSslProxyRequest request = new DeleteTargetSslProxyRequest - { - Project = "projectaa6ff846", - TargetSslProxy = "target_ssl_proxy8c6691c6", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.TargetSslProxy); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetSslProxyRequest request = new DeleteTargetSslProxyRequest - { - Project = "projectaa6ff846", - TargetSslProxy = "target_ssl_proxy8c6691c6", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.TargetSslProxy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.TargetSslProxy, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetTargetSslProxyRequest request = new GetTargetSslProxyRequest { Project = "projectaa6ff846", @@ -240,6 +64,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetTargetSslProxyRequest request = new GetTargetSslProxyRequest { Project = "projectaa6ff846", @@ -274,6 +99,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetTargetSslProxyRequest request = new GetTargetSslProxyRequest { Project = "projectaa6ff846", @@ -306,6 +132,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetTargetSslProxyRequest request = new GetTargetSslProxyRequest { Project = "projectaa6ff846", @@ -335,911 +162,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetSslProxyRequest request = new InsertTargetSslProxyRequest - { - RequestId = "request_id362c8df6", - TargetSslProxyResource = new TargetSslProxy(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetSslProxyRequest request = new InsertTargetSslProxyRequest - { - RequestId = "request_id362c8df6", - TargetSslProxyResource = new TargetSslProxy(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetSslProxyRequest request = new InsertTargetSslProxyRequest - { - TargetSslProxyResource = new TargetSslProxy(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.TargetSslProxyResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetSslProxyRequest request = new InsertTargetSslProxyRequest - { - TargetSslProxyResource = new TargetSslProxy(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.TargetSslProxyResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.TargetSslProxyResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetBackendServiceRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetBackendServiceTargetSslProxyRequest request = new SetBackendServiceTargetSslProxyRequest - { - RequestId = "request_id362c8df6", - TargetSslProxiesSetBackendServiceRequestResource = new TargetSslProxiesSetBackendServiceRequest(), - Project = "projectaa6ff846", - TargetSslProxy = "target_ssl_proxy8c6691c6", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetBackendService(request, moq::It.IsAny())).Returns(expectedResponse); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetBackendService(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetBackendServiceRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetBackendServiceTargetSslProxyRequest request = new SetBackendServiceTargetSslProxyRequest - { - RequestId = "request_id362c8df6", - TargetSslProxiesSetBackendServiceRequestResource = new TargetSslProxiesSetBackendServiceRequest(), - Project = "projectaa6ff846", - TargetSslProxy = "target_ssl_proxy8c6691c6", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetBackendServiceAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetBackendServiceAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetBackendServiceAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetBackendService() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetBackendServiceTargetSslProxyRequest request = new SetBackendServiceTargetSslProxyRequest - { - TargetSslProxiesSetBackendServiceRequestResource = new TargetSslProxiesSetBackendServiceRequest(), - Project = "projectaa6ff846", - TargetSslProxy = "target_ssl_proxy8c6691c6", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetBackendService(request, moq::It.IsAny())).Returns(expectedResponse); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetBackendService(request.Project, request.TargetSslProxy, request.TargetSslProxiesSetBackendServiceRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetBackendServiceAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetBackendServiceTargetSslProxyRequest request = new SetBackendServiceTargetSslProxyRequest - { - TargetSslProxiesSetBackendServiceRequestResource = new TargetSslProxiesSetBackendServiceRequest(), - Project = "projectaa6ff846", - TargetSslProxy = "target_ssl_proxy8c6691c6", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetBackendServiceAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetBackendServiceAsync(request.Project, request.TargetSslProxy, request.TargetSslProxiesSetBackendServiceRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetBackendServiceAsync(request.Project, request.TargetSslProxy, request.TargetSslProxiesSetBackendServiceRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetProxyHeaderRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetProxyHeaderTargetSslProxyRequest request = new SetProxyHeaderTargetSslProxyRequest - { - RequestId = "request_id362c8df6", - TargetSslProxiesSetProxyHeaderRequestResource = new TargetSslProxiesSetProxyHeaderRequest(), - Project = "projectaa6ff846", - TargetSslProxy = "target_ssl_proxy8c6691c6", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetProxyHeader(request, moq::It.IsAny())).Returns(expectedResponse); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetProxyHeader(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetProxyHeaderRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetProxyHeaderTargetSslProxyRequest request = new SetProxyHeaderTargetSslProxyRequest - { - RequestId = "request_id362c8df6", - TargetSslProxiesSetProxyHeaderRequestResource = new TargetSslProxiesSetProxyHeaderRequest(), - Project = "projectaa6ff846", - TargetSslProxy = "target_ssl_proxy8c6691c6", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetProxyHeaderAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetProxyHeaderAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetProxyHeaderAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetProxyHeader() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetProxyHeaderTargetSslProxyRequest request = new SetProxyHeaderTargetSslProxyRequest - { - TargetSslProxiesSetProxyHeaderRequestResource = new TargetSslProxiesSetProxyHeaderRequest(), - Project = "projectaa6ff846", - TargetSslProxy = "target_ssl_proxy8c6691c6", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetProxyHeader(request, moq::It.IsAny())).Returns(expectedResponse); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetProxyHeader(request.Project, request.TargetSslProxy, request.TargetSslProxiesSetProxyHeaderRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetProxyHeaderAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetProxyHeaderTargetSslProxyRequest request = new SetProxyHeaderTargetSslProxyRequest - { - TargetSslProxiesSetProxyHeaderRequestResource = new TargetSslProxiesSetProxyHeaderRequest(), - Project = "projectaa6ff846", - TargetSslProxy = "target_ssl_proxy8c6691c6", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetProxyHeaderAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetProxyHeaderAsync(request.Project, request.TargetSslProxy, request.TargetSslProxiesSetProxyHeaderRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetProxyHeaderAsync(request.Project, request.TargetSslProxy, request.TargetSslProxiesSetProxyHeaderRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetSslCertificatesRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSslCertificatesTargetSslProxyRequest request = new SetSslCertificatesTargetSslProxyRequest - { - RequestId = "request_id362c8df6", - TargetSslProxiesSetSslCertificatesRequestResource = new TargetSslProxiesSetSslCertificatesRequest(), - Project = "projectaa6ff846", - TargetSslProxy = "target_ssl_proxy8c6691c6", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetSslCertificates(request, moq::It.IsAny())).Returns(expectedResponse); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetSslCertificates(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetSslCertificatesRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSslCertificatesTargetSslProxyRequest request = new SetSslCertificatesTargetSslProxyRequest - { - RequestId = "request_id362c8df6", - TargetSslProxiesSetSslCertificatesRequestResource = new TargetSslProxiesSetSslCertificatesRequest(), - Project = "projectaa6ff846", - TargetSslProxy = "target_ssl_proxy8c6691c6", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetSslCertificatesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetSslCertificatesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetSslCertificatesAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetSslCertificates() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSslCertificatesTargetSslProxyRequest request = new SetSslCertificatesTargetSslProxyRequest - { - TargetSslProxiesSetSslCertificatesRequestResource = new TargetSslProxiesSetSslCertificatesRequest(), - Project = "projectaa6ff846", - TargetSslProxy = "target_ssl_proxy8c6691c6", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetSslCertificates(request, moq::It.IsAny())).Returns(expectedResponse); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetSslCertificates(request.Project, request.TargetSslProxy, request.TargetSslProxiesSetSslCertificatesRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetSslCertificatesAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSslCertificatesTargetSslProxyRequest request = new SetSslCertificatesTargetSslProxyRequest - { - TargetSslProxiesSetSslCertificatesRequestResource = new TargetSslProxiesSetSslCertificatesRequest(), - Project = "projectaa6ff846", - TargetSslProxy = "target_ssl_proxy8c6691c6", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetSslCertificatesAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetSslCertificatesAsync(request.Project, request.TargetSslProxy, request.TargetSslProxiesSetSslCertificatesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetSslCertificatesAsync(request.Project, request.TargetSslProxy, request.TargetSslProxiesSetSslCertificatesRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetSslPolicyRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSslPolicyTargetSslProxyRequest request = new SetSslPolicyTargetSslProxyRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - SslPolicyReferenceResource = new SslPolicyReference(), - TargetSslProxy = "target_ssl_proxy8c6691c6", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetSslPolicy(request, moq::It.IsAny())).Returns(expectedResponse); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetSslPolicy(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetSslPolicyRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSslPolicyTargetSslProxyRequest request = new SetSslPolicyTargetSslProxyRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - SslPolicyReferenceResource = new SslPolicyReference(), - TargetSslProxy = "target_ssl_proxy8c6691c6", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetSslPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetSslPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetSslPolicyAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetSslPolicy() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSslPolicyTargetSslProxyRequest request = new SetSslPolicyTargetSslProxyRequest - { - Project = "projectaa6ff846", - SslPolicyReferenceResource = new SslPolicyReference(), - TargetSslProxy = "target_ssl_proxy8c6691c6", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetSslPolicy(request, moq::It.IsAny())).Returns(expectedResponse); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetSslPolicy(request.Project, request.TargetSslProxy, request.SslPolicyReferenceResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetSslPolicyAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetSslPolicyTargetSslProxyRequest request = new SetSslPolicyTargetSslProxyRequest - { - Project = "projectaa6ff846", - SslPolicyReferenceResource = new SslPolicyReference(), - TargetSslProxy = "target_ssl_proxy8c6691c6", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetSslPolicyAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetSslProxiesClient client = new TargetSslProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetSslPolicyAsync(request.Project, request.TargetSslProxy, request.SslPolicyReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetSslPolicyAsync(request.Project, request.TargetSslProxy, request.SslPolicyReferenceResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetTcpProxiesClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetTcpProxiesClientTest.g.cs index bf2d7b0721a1..1c262553fb33 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetTcpProxiesClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetTcpProxiesClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,188 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedTargetTcpProxiesClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetTcpProxyRequest request = new DeleteTargetTcpProxyRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - TargetTcpProxy = "target_tcp_proxy074a59b9", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - TargetTcpProxiesClient client = new TargetTcpProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetTcpProxyRequest request = new DeleteTargetTcpProxyRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - TargetTcpProxy = "target_tcp_proxy074a59b9", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetTcpProxiesClient client = new TargetTcpProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetTcpProxyRequest request = new DeleteTargetTcpProxyRequest - { - Project = "projectaa6ff846", - TargetTcpProxy = "target_tcp_proxy074a59b9", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - TargetTcpProxiesClient client = new TargetTcpProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.TargetTcpProxy); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetTcpProxyRequest request = new DeleteTargetTcpProxyRequest - { - Project = "projectaa6ff846", - TargetTcpProxy = "target_tcp_proxy074a59b9", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetTcpProxiesClient client = new TargetTcpProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.TargetTcpProxy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.TargetTcpProxy, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetTargetTcpProxyRequest request = new GetTargetTcpProxyRequest { Project = "projectaa6ff846", @@ -236,6 +60,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetTargetTcpProxyRequest request = new GetTargetTcpProxyRequest { Project = "projectaa6ff846", @@ -266,6 +91,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetTargetTcpProxyRequest request = new GetTargetTcpProxyRequest { Project = "projectaa6ff846", @@ -294,6 +120,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetTargetTcpProxyRequest request = new GetTargetTcpProxyRequest { Project = "projectaa6ff846", @@ -319,547 +146,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetTcpProxyRequest request = new InsertTargetTcpProxyRequest - { - RequestId = "request_id362c8df6", - TargetTcpProxyResource = new TargetTcpProxy(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - TargetTcpProxiesClient client = new TargetTcpProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetTcpProxyRequest request = new InsertTargetTcpProxyRequest - { - RequestId = "request_id362c8df6", - TargetTcpProxyResource = new TargetTcpProxy(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetTcpProxiesClient client = new TargetTcpProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetTcpProxyRequest request = new InsertTargetTcpProxyRequest - { - TargetTcpProxyResource = new TargetTcpProxy(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - TargetTcpProxiesClient client = new TargetTcpProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.TargetTcpProxyResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetTcpProxyRequest request = new InsertTargetTcpProxyRequest - { - TargetTcpProxyResource = new TargetTcpProxy(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetTcpProxiesClient client = new TargetTcpProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.TargetTcpProxyResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.TargetTcpProxyResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetBackendServiceRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetBackendServiceTargetTcpProxyRequest request = new SetBackendServiceTargetTcpProxyRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - TargetTcpProxiesSetBackendServiceRequestResource = new TargetTcpProxiesSetBackendServiceRequest(), - TargetTcpProxy = "target_tcp_proxy074a59b9", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetBackendService(request, moq::It.IsAny())).Returns(expectedResponse); - TargetTcpProxiesClient client = new TargetTcpProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetBackendService(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetBackendServiceRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetBackendServiceTargetTcpProxyRequest request = new SetBackendServiceTargetTcpProxyRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - TargetTcpProxiesSetBackendServiceRequestResource = new TargetTcpProxiesSetBackendServiceRequest(), - TargetTcpProxy = "target_tcp_proxy074a59b9", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetBackendServiceAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetTcpProxiesClient client = new TargetTcpProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetBackendServiceAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetBackendServiceAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetBackendService() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetBackendServiceTargetTcpProxyRequest request = new SetBackendServiceTargetTcpProxyRequest - { - Project = "projectaa6ff846", - TargetTcpProxiesSetBackendServiceRequestResource = new TargetTcpProxiesSetBackendServiceRequest(), - TargetTcpProxy = "target_tcp_proxy074a59b9", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetBackendService(request, moq::It.IsAny())).Returns(expectedResponse); - TargetTcpProxiesClient client = new TargetTcpProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetBackendService(request.Project, request.TargetTcpProxy, request.TargetTcpProxiesSetBackendServiceRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetBackendServiceAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetBackendServiceTargetTcpProxyRequest request = new SetBackendServiceTargetTcpProxyRequest - { - Project = "projectaa6ff846", - TargetTcpProxiesSetBackendServiceRequestResource = new TargetTcpProxiesSetBackendServiceRequest(), - TargetTcpProxy = "target_tcp_proxy074a59b9", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetBackendServiceAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetTcpProxiesClient client = new TargetTcpProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetBackendServiceAsync(request.Project, request.TargetTcpProxy, request.TargetTcpProxiesSetBackendServiceRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetBackendServiceAsync(request.Project, request.TargetTcpProxy, request.TargetTcpProxiesSetBackendServiceRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetProxyHeaderRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetProxyHeaderTargetTcpProxyRequest request = new SetProxyHeaderTargetTcpProxyRequest - { - RequestId = "request_id362c8df6", - TargetTcpProxiesSetProxyHeaderRequestResource = new TargetTcpProxiesSetProxyHeaderRequest(), - Project = "projectaa6ff846", - TargetTcpProxy = "target_tcp_proxy074a59b9", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetProxyHeader(request, moq::It.IsAny())).Returns(expectedResponse); - TargetTcpProxiesClient client = new TargetTcpProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetProxyHeader(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetProxyHeaderRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetProxyHeaderTargetTcpProxyRequest request = new SetProxyHeaderTargetTcpProxyRequest - { - RequestId = "request_id362c8df6", - TargetTcpProxiesSetProxyHeaderRequestResource = new TargetTcpProxiesSetProxyHeaderRequest(), - Project = "projectaa6ff846", - TargetTcpProxy = "target_tcp_proxy074a59b9", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetProxyHeaderAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetTcpProxiesClient client = new TargetTcpProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetProxyHeaderAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetProxyHeaderAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetProxyHeader() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetProxyHeaderTargetTcpProxyRequest request = new SetProxyHeaderTargetTcpProxyRequest - { - TargetTcpProxiesSetProxyHeaderRequestResource = new TargetTcpProxiesSetProxyHeaderRequest(), - Project = "projectaa6ff846", - TargetTcpProxy = "target_tcp_proxy074a59b9", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetProxyHeader(request, moq::It.IsAny())).Returns(expectedResponse); - TargetTcpProxiesClient client = new TargetTcpProxiesClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetProxyHeader(request.Project, request.TargetTcpProxy, request.TargetTcpProxiesSetProxyHeaderRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetProxyHeaderAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetProxyHeaderTargetTcpProxyRequest request = new SetProxyHeaderTargetTcpProxyRequest - { - TargetTcpProxiesSetProxyHeaderRequestResource = new TargetTcpProxiesSetProxyHeaderRequest(), - Project = "projectaa6ff846", - TargetTcpProxy = "target_tcp_proxy074a59b9", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetProxyHeaderAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetTcpProxiesClient client = new TargetTcpProxiesClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetProxyHeaderAsync(request.Project, request.TargetTcpProxy, request.TargetTcpProxiesSetProxyHeaderRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetProxyHeaderAsync(request.Project, request.TargetTcpProxy, request.TargetTcpProxiesSetProxyHeaderRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetVpnGatewaysClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetVpnGatewaysClientTest.g.cs index 8b5d1e046fee..5ffdfdc8e52a 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetVpnGatewaysClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetVpnGatewaysClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedTargetVpnGatewaysClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetVpnGatewayRequest request = new DeleteTargetVpnGatewayRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - TargetVpnGateway = "target_vpn_gateway6c481371", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - TargetVpnGatewaysClient client = new TargetVpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetVpnGatewayRequest request = new DeleteTargetVpnGatewayRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - TargetVpnGateway = "target_vpn_gateway6c481371", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetVpnGatewaysClient client = new TargetVpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetVpnGatewayRequest request = new DeleteTargetVpnGatewayRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - TargetVpnGateway = "target_vpn_gateway6c481371", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - TargetVpnGatewaysClient client = new TargetVpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.TargetVpnGateway); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteTargetVpnGatewayRequest request = new DeleteTargetVpnGatewayRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - TargetVpnGateway = "target_vpn_gateway6c481371", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetVpnGatewaysClient client = new TargetVpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.TargetVpnGateway, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.TargetVpnGateway, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetTargetVpnGatewayRequest request = new GetTargetVpnGatewayRequest { Region = "regionedb20d96", @@ -246,6 +66,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetTargetVpnGatewayRequest request = new GetTargetVpnGatewayRequest { Region = "regionedb20d96", @@ -282,6 +103,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetTargetVpnGatewayRequest request = new GetTargetVpnGatewayRequest { Region = "regionedb20d96", @@ -316,6 +138,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetTargetVpnGatewayRequest request = new GetTargetVpnGatewayRequest { Region = "regionedb20d96", @@ -347,187 +170,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetVpnGatewayRequest request = new InsertTargetVpnGatewayRequest - { - TargetVpnGatewayResource = new TargetVpnGateway(), - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - TargetVpnGatewaysClient client = new TargetVpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetVpnGatewayRequest request = new InsertTargetVpnGatewayRequest - { - TargetVpnGatewayResource = new TargetVpnGateway(), - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetVpnGatewaysClient client = new TargetVpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetVpnGatewayRequest request = new InsertTargetVpnGatewayRequest - { - TargetVpnGatewayResource = new TargetVpnGateway(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - TargetVpnGatewaysClient client = new TargetVpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.TargetVpnGatewayResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertTargetVpnGatewayRequest request = new InsertTargetVpnGatewayRequest - { - TargetVpnGatewayResource = new TargetVpnGateway(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - TargetVpnGatewaysClient client = new TargetVpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.TargetVpnGatewayResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.TargetVpnGatewayResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/UrlMapsClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/UrlMapsClientTest.g.cs index 51ee4a2622ff..578317e9d2e1 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/UrlMapsClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/UrlMapsClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,188 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedUrlMapsClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteUrlMapRequest request = new DeleteUrlMapRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - UrlMapsClient client = new UrlMapsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteUrlMapRequest request = new DeleteUrlMapRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - UrlMapsClient client = new UrlMapsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteUrlMapRequest request = new DeleteUrlMapRequest - { - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - UrlMapsClient client = new UrlMapsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.UrlMap); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteUrlMapRequest request = new DeleteUrlMapRequest - { - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - UrlMapsClient client = new UrlMapsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.UrlMap, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.UrlMap, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetUrlMapRequest request = new GetUrlMapRequest { Project = "projectaa6ff846", @@ -242,6 +66,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetUrlMapRequest request = new GetUrlMapRequest { Project = "projectaa6ff846", @@ -278,6 +103,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetUrlMapRequest request = new GetUrlMapRequest { Project = "projectaa6ff846", @@ -312,6 +138,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); GetUrlMapRequest request = new GetUrlMapRequest { Project = "projectaa6ff846", @@ -344,734 +171,11 @@ public void Get() mockGrpcClient.VerifyAll(); } - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertUrlMapRequest request = new InsertUrlMapRequest - { - RequestId = "request_id362c8df6", - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - UrlMapsClient client = new UrlMapsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertUrlMapRequest request = new InsertUrlMapRequest - { - RequestId = "request_id362c8df6", - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - UrlMapsClient client = new UrlMapsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertUrlMapRequest request = new InsertUrlMapRequest - { - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - UrlMapsClient client = new UrlMapsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.UrlMapResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertUrlMapRequest request = new InsertUrlMapRequest - { - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - UrlMapsClient client = new UrlMapsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.UrlMapResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.UrlMapResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void InvalidateCacheRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InvalidateCacheUrlMapRequest request = new InvalidateCacheUrlMapRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - CacheInvalidationRuleResource = new CacheInvalidationRule(), - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InvalidateCache(request, moq::It.IsAny())).Returns(expectedResponse); - UrlMapsClient client = new UrlMapsClientImpl(mockGrpcClient.Object, null); - Operation response = client.InvalidateCache(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InvalidateCacheRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InvalidateCacheUrlMapRequest request = new InvalidateCacheUrlMapRequest - { - RequestId = "request_id362c8df6", - Project = "projectaa6ff846", - CacheInvalidationRuleResource = new CacheInvalidationRule(), - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InvalidateCacheAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - UrlMapsClient client = new UrlMapsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InvalidateCacheAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InvalidateCacheAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void InvalidateCache() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InvalidateCacheUrlMapRequest request = new InvalidateCacheUrlMapRequest - { - Project = "projectaa6ff846", - CacheInvalidationRuleResource = new CacheInvalidationRule(), - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InvalidateCache(request, moq::It.IsAny())).Returns(expectedResponse); - UrlMapsClient client = new UrlMapsClientImpl(mockGrpcClient.Object, null); - Operation response = client.InvalidateCache(request.Project, request.UrlMap, request.CacheInvalidationRuleResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InvalidateCacheAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InvalidateCacheUrlMapRequest request = new InvalidateCacheUrlMapRequest - { - Project = "projectaa6ff846", - CacheInvalidationRuleResource = new CacheInvalidationRule(), - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InvalidateCacheAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - UrlMapsClient client = new UrlMapsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InvalidateCacheAsync(request.Project, request.UrlMap, request.CacheInvalidationRuleResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InvalidateCacheAsync(request.Project, request.UrlMap, request.CacheInvalidationRuleResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void PatchRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchUrlMapRequest request = new PatchUrlMapRequest - { - RequestId = "request_id362c8df6", - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - UrlMapsClient client = new UrlMapsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchUrlMapRequest request = new PatchUrlMapRequest - { - RequestId = "request_id362c8df6", - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - UrlMapsClient client = new UrlMapsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Patch() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchUrlMapRequest request = new PatchUrlMapRequest - { - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Patch(request, moq::It.IsAny())).Returns(expectedResponse); - UrlMapsClient client = new UrlMapsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Patch(request.Project, request.UrlMap, request.UrlMapResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task PatchAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - PatchUrlMapRequest request = new PatchUrlMapRequest - { - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.PatchAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - UrlMapsClient client = new UrlMapsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.PatchAsync(request.Project, request.UrlMap, request.UrlMapResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.PatchAsync(request.Project, request.UrlMap, request.UrlMapResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void UpdateRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateUrlMapRequest request = new UpdateUrlMapRequest - { - RequestId = "request_id362c8df6", - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); - UrlMapsClient client = new UrlMapsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task UpdateRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateUrlMapRequest request = new UpdateUrlMapRequest - { - RequestId = "request_id362c8df6", - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - UrlMapsClient client = new UrlMapsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Update() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateUrlMapRequest request = new UpdateUrlMapRequest - { - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Update(request, moq::It.IsAny())).Returns(expectedResponse); - UrlMapsClient client = new UrlMapsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Update(request.Project, request.UrlMap, request.UrlMapResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task UpdateAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - UpdateUrlMapRequest request = new UpdateUrlMapRequest - { - UrlMapResource = new UrlMap(), - Project = "projectaa6ff846", - UrlMap = "url_map3ccdbf57", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.UpdateAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - UrlMapsClient client = new UrlMapsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.UpdateAsync(request.Project, request.UrlMap, request.UrlMapResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.UpdateAsync(request.Project, request.UrlMap, request.UrlMapResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void ValidateRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); ValidateUrlMapRequest request = new ValidateUrlMapRequest { Project = "projectaa6ff846", @@ -1093,6 +197,7 @@ public void ValidateRequestObject() public async stt::Task ValidateRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); ValidateUrlMapRequest request = new ValidateUrlMapRequest { Project = "projectaa6ff846", @@ -1116,6 +221,7 @@ public void ValidateRequestObject() public void Validate() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); ValidateUrlMapRequest request = new ValidateUrlMapRequest { Project = "projectaa6ff846", @@ -1137,6 +243,7 @@ public void Validate() public async stt::Task ValidateAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock().Object); ValidateUrlMapRequest request = new ValidateUrlMapRequest { Project = "projectaa6ff846", diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/VpnGatewaysClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/VpnGatewaysClientTest.g.cs index 3d4a365332be..77cb1d85fa22 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/VpnGatewaysClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/VpnGatewaysClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedVpnGatewaysClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteVpnGatewayRequest request = new DeleteVpnGatewayRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - VpnGateway = "vpn_gatewayaa15de14", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - VpnGatewaysClient client = new VpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteVpnGatewayRequest request = new DeleteVpnGatewayRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Project = "projectaa6ff846", - VpnGateway = "vpn_gatewayaa15de14", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - VpnGatewaysClient client = new VpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteVpnGatewayRequest request = new DeleteVpnGatewayRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - VpnGateway = "vpn_gatewayaa15de14", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - VpnGatewaysClient client = new VpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.VpnGateway); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteVpnGatewayRequest request = new DeleteVpnGatewayRequest - { - Region = "regionedb20d96", - Project = "projectaa6ff846", - VpnGateway = "vpn_gatewayaa15de14", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - VpnGatewaysClient client = new VpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.VpnGateway, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.VpnGateway, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetVpnGatewayRequest request = new GetVpnGatewayRequest { Region = "regionedb20d96", @@ -252,6 +72,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetVpnGatewayRequest request = new GetVpnGatewayRequest { Region = "regionedb20d96", @@ -294,6 +115,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetVpnGatewayRequest request = new GetVpnGatewayRequest { Region = "regionedb20d96", @@ -334,6 +156,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetVpnGatewayRequest request = new GetVpnGatewayRequest { Region = "regionedb20d96", @@ -376,6 +199,7 @@ public void Get() public void GetStatusRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetStatusVpnGatewayRequest request = new GetStatusVpnGatewayRequest { Region = "regionedb20d96", @@ -397,6 +221,7 @@ public void GetStatusRequestObject() public async stt::Task GetStatusRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetStatusVpnGatewayRequest request = new GetStatusVpnGatewayRequest { Region = "regionedb20d96", @@ -420,6 +245,7 @@ public void GetStatusRequestObject() public void GetStatus() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetStatusVpnGatewayRequest request = new GetStatusVpnGatewayRequest { Region = "regionedb20d96", @@ -441,6 +267,7 @@ public void GetStatus() public async stt::Task GetStatusAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetStatusVpnGatewayRequest request = new GetStatusVpnGatewayRequest { Region = "regionedb20d96", @@ -460,378 +287,11 @@ public void GetStatus() mockGrpcClient.VerifyAll(); } - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertVpnGatewayRequest request = new InsertVpnGatewayRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - VpnGatewayResource = new VpnGateway(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - VpnGatewaysClient client = new VpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertVpnGatewayRequest request = new InsertVpnGatewayRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - VpnGatewayResource = new VpnGateway(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - VpnGatewaysClient client = new VpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertVpnGatewayRequest request = new InsertVpnGatewayRequest - { - Region = "regionedb20d96", - VpnGatewayResource = new VpnGateway(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - VpnGatewaysClient client = new VpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.VpnGatewayResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertVpnGatewayRequest request = new InsertVpnGatewayRequest - { - Region = "regionedb20d96", - VpnGatewayResource = new VpnGateway(), - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - VpnGatewaysClient client = new VpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.VpnGatewayResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.VpnGatewayResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetLabelsRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsVpnGatewayRequest request = new SetLabelsVpnGatewayRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Resource = "resource164eab96", - Project = "projectaa6ff846", - RegionSetLabelsRequestResource = new RegionSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabels(request, moq::It.IsAny())).Returns(expectedResponse); - VpnGatewaysClient client = new VpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetLabels(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetLabelsRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsVpnGatewayRequest request = new SetLabelsVpnGatewayRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - Resource = "resource164eab96", - Project = "projectaa6ff846", - RegionSetLabelsRequestResource = new RegionSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabelsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - VpnGatewaysClient client = new VpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetLabelsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetLabelsAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void SetLabels() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsVpnGatewayRequest request = new SetLabelsVpnGatewayRequest - { - Region = "regionedb20d96", - Resource = "resource164eab96", - Project = "projectaa6ff846", - RegionSetLabelsRequestResource = new RegionSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabels(request, moq::It.IsAny())).Returns(expectedResponse); - VpnGatewaysClient client = new VpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation response = client.SetLabels(request.Project, request.Region, request.Resource, request.RegionSetLabelsRequestResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task SetLabelsAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - SetLabelsVpnGatewayRequest request = new SetLabelsVpnGatewayRequest - { - Region = "regionedb20d96", - Resource = "resource164eab96", - Project = "projectaa6ff846", - RegionSetLabelsRequestResource = new RegionSetLabelsRequest(), - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.SetLabelsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - VpnGatewaysClient client = new VpnGatewaysClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.SetLabelsAsync(request.Project, request.Region, request.Resource, request.RegionSetLabelsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.SetLabelsAsync(request.Project, request.Region, request.Resource, request.RegionSetLabelsRequestResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void TestIamPermissionsRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsVpnGatewayRequest request = new TestIamPermissionsVpnGatewayRequest { Region = "regionedb20d96", @@ -857,6 +317,7 @@ public void TestIamPermissionsRequestObject() public async stt::Task TestIamPermissionsRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsVpnGatewayRequest request = new TestIamPermissionsVpnGatewayRequest { Region = "regionedb20d96", @@ -884,6 +345,7 @@ public void TestIamPermissionsRequestObject() public void TestIamPermissions() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsVpnGatewayRequest request = new TestIamPermissionsVpnGatewayRequest { Region = "regionedb20d96", @@ -909,6 +371,7 @@ public void TestIamPermissions() public async stt::Task TestIamPermissionsAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); TestIamPermissionsVpnGatewayRequest request = new TestIamPermissionsVpnGatewayRequest { Region = "regionedb20d96", diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/VpnTunnelsClientTest.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/VpnTunnelsClientTest.g.cs index 1550055dfea3..17738b7dec82 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/VpnTunnelsClientTest.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/VpnTunnelsClientTest.g.cs @@ -15,6 +15,7 @@ // Generated code. DO NOT EDIT! using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using grpccore = Grpc.Core; using moq = Moq; using st = System.Threading; @@ -26,192 +27,11 @@ namespace Google.Cloud.Compute.V1.Tests /// Generated unit tests. public sealed class GeneratedVpnTunnelsClientTest { - [xunit::FactAttribute] - public void DeleteRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteVpnTunnelRequest request = new DeleteVpnTunnelRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - VpnTunnel = "vpn_tunnelfa4123fd", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - VpnTunnelsClient client = new VpnTunnelsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteVpnTunnelRequest request = new DeleteVpnTunnelRequest - { - RequestId = "request_id362c8df6", - Region = "regionedb20d96", - VpnTunnel = "vpn_tunnelfa4123fd", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - VpnTunnelsClient client = new VpnTunnelsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Delete() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteVpnTunnelRequest request = new DeleteVpnTunnelRequest - { - Region = "regionedb20d96", - VpnTunnel = "vpn_tunnelfa4123fd", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny())).Returns(expectedResponse); - VpnTunnelsClient client = new VpnTunnelsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Delete(request.Project, request.Region, request.VpnTunnel); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task DeleteAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - DeleteVpnTunnelRequest request = new DeleteVpnTunnelRequest - { - Region = "regionedb20d96", - VpnTunnel = "vpn_tunnelfa4123fd", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - VpnTunnelsClient client = new VpnTunnelsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.DeleteAsync(request.Project, request.Region, request.VpnTunnel, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.DeleteAsync(request.Project, request.Region, request.VpnTunnel, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - [xunit::FactAttribute] public void GetRequestObject() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetVpnTunnelRequest request = new GetVpnTunnelRequest { Region = "regionedb20d96", @@ -260,6 +80,7 @@ public void GetRequestObject() public async stt::Task GetRequestObjectAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetVpnTunnelRequest request = new GetVpnTunnelRequest { Region = "regionedb20d96", @@ -310,6 +131,7 @@ public void GetRequestObject() public void Get() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetVpnTunnelRequest request = new GetVpnTunnelRequest { Region = "regionedb20d96", @@ -358,6 +180,7 @@ public void Get() public async stt::Task GetAsync() { moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); + mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock().Object); GetVpnTunnelRequest request = new GetVpnTunnelRequest { Region = "regionedb20d96", @@ -403,187 +226,5 @@ public void Get() xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); } - - [xunit::FactAttribute] - public void InsertRequestObject() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertVpnTunnelRequest request = new InsertVpnTunnelRequest - { - RequestId = "request_id362c8df6", - VpnTunnelResource = new VpnTunnel(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - VpnTunnelsClient client = new VpnTunnelsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertRequestObjectAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertVpnTunnelRequest request = new InsertVpnTunnelRequest - { - RequestId = "request_id362c8df6", - VpnTunnelResource = new VpnTunnel(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - VpnTunnelsClient client = new VpnTunnelsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public void Insert() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertVpnTunnelRequest request = new InsertVpnTunnelRequest - { - VpnTunnelResource = new VpnTunnel(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.Insert(request, moq::It.IsAny())).Returns(expectedResponse); - VpnTunnelsClient client = new VpnTunnelsClientImpl(mockGrpcClient.Object, null); - Operation response = client.Insert(request.Project, request.Region, request.VpnTunnelResource); - xunit::Assert.Same(expectedResponse, response); - mockGrpcClient.VerifyAll(); - } - - [xunit::FactAttribute] - public async stt::Task InsertAsync() - { - moq::Mock mockGrpcClient = new moq::Mock(moq::MockBehavior.Strict); - InsertVpnTunnelRequest request = new InsertVpnTunnelRequest - { - VpnTunnelResource = new VpnTunnel(), - Region = "regionedb20d96", - Project = "projectaa6ff846", - }; - Operation expectedResponse = new Operation - { - Id = 11672635353343658936UL, - Kind = "kindf7aa39d9", - Name = "name1c9368b0", - User = "userb1cb11ee", - Zone = "zone255f4ea8", - CreationTimestamp = "creation_timestamp235e59a1", - StartTime = "start_timebd8dd9c4", - OperationGroupId = "operation_group_idd2040cf0", - TargetLink = "target_link9b435dc0", - Progress = 278622268, - Error = new Error(), - EndTime = "end_time89285d30", - Region = "regionedb20d96", - OperationType = "operation_typeece9e153", - Status = Operation.Types.Status.Pending, - HttpErrorMessage = "http_error_messageb5ef3c7f", - TargetId = 6263187990225347157UL, - ClientOperationId = "client_operation_id4e51b631", - StatusMessage = "status_message2c618f86", - HttpErrorStatusCode = 1766362655, - Description = "description2cf9da67", - InsertTime = "insert_time7467185a", - SelfLink = "self_link7e87f12d", - Warnings = { new Warnings(), }, - }; - mockGrpcClient.Setup(x => x.InsertAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); - VpnTunnelsClient client = new VpnTunnelsClientImpl(mockGrpcClient.Object, null); - Operation responseCallSettings = await client.InsertAsync(request.Project, request.Region, request.VpnTunnelResource, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); - xunit::Assert.Same(expectedResponse, responseCallSettings); - Operation responseCancellationToken = await client.InsertAsync(request.Project, request.Region, request.VpnTunnelResource, st::CancellationToken.None); - xunit::Assert.Same(expectedResponse, responseCancellationToken); - mockGrpcClient.VerifyAll(); - } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/AddressesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/AddressesClient.g.cs index cdc425562daf..50a8e06236d2 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/AddressesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/AddressesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -46,8 +47,10 @@ private AddressesSettings(AddressesSettings existing) : base(existing) gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; OnCopy(existing); } @@ -78,6 +81,24 @@ private AddressesSettings(AddressesSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to AddressesClient.Delete and + /// AddressesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to AddressesClient.Get and /// AddressesClient.GetAsync. @@ -102,6 +123,24 @@ private AddressesSettings(AddressesSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to AddressesClient.Insert and + /// AddressesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to AddressesClient.List /// and AddressesClient.ListAsync. @@ -352,7 +391,7 @@ internal static AddressesClient Create(grpccore::CallInvoker callInvoker, Addres /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteAddressRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteAddressRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -361,7 +400,7 @@ internal static AddressesClient Create(grpccore::CallInvoker callInvoker, Addres /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteAddressRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteAddressRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -370,9 +409,35 @@ internal static AddressesClient Create(grpccore::CallInvoker callInvoker, Addres /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteAddressRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteAddressRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified address resource. /// @@ -387,7 +452,7 @@ internal static AddressesClient Create(grpccore::CallInvoker callInvoker, Addres /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string address, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string address, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteAddressRequest { Address = gax::GaxPreconditions.CheckNotNullOrEmpty(address, nameof(address)), @@ -409,7 +474,7 @@ internal static AddressesClient Create(grpccore::CallInvoker callInvoker, Addres /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string address, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string address, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteAddressRequest { Address = gax::GaxPreconditions.CheckNotNullOrEmpty(address, nameof(address)), @@ -431,7 +496,7 @@ internal static AddressesClient Create(grpccore::CallInvoker callInvoker, Addres /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string address, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string address, st::CancellationToken cancellationToken) => DeleteAsync(project, region, address, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -528,7 +593,7 @@ internal static AddressesClient Create(grpccore::CallInvoker callInvoker, Addres /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertAddressRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertAddressRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -537,7 +602,7 @@ internal static AddressesClient Create(grpccore::CallInvoker callInvoker, Addres /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertAddressRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertAddressRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -546,9 +611,35 @@ internal static AddressesClient Create(grpccore::CallInvoker callInvoker, Addres /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertAddressRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertAddressRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates an address resource in the specified project by using the data included in the request. /// @@ -563,7 +654,7 @@ internal static AddressesClient Create(grpccore::CallInvoker callInvoker, Addres /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, Address addressResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, Address addressResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertAddressRequest { AddressResource = gax::GaxPreconditions.CheckNotNull(addressResource, nameof(addressResource)), @@ -585,7 +676,7 @@ internal static AddressesClient Create(grpccore::CallInvoker callInvoker, Addres /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, Address addressResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, Address addressResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertAddressRequest { AddressResource = gax::GaxPreconditions.CheckNotNull(addressResource, nameof(addressResource)), @@ -607,7 +698,7 @@ internal static AddressesClient Create(grpccore::CallInvoker callInvoker, Addres /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, Address addressResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, Address addressResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, addressResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -711,6 +802,8 @@ public AddressesClientImpl(Addresses.AddressesClient grpcClient, AddressesSettin GrpcClient = grpcClient; AddressesSettings effectiveSettings = settings ?? AddressesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); _callAggregatedList = clientHelper.BuildApiCall(grpcClient.AggregatedListAsync, grpcClient.AggregatedList, effectiveSettings.AggregatedListSettings).WithGoogleRequestParam("project", request => request.Project); Modify_ApiCall(ref _callAggregatedList); Modify_AggregatedListApiCall(ref _callAggregatedList); @@ -782,16 +875,22 @@ public AddressesClientImpl(Addresses.AddressesClient grpcClient, AddressesSettin return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified address resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteAddressRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteAddressRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteAddressRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -800,10 +899,13 @@ public override Operation Delete(DeleteAddressRequest request, gaxgrpc::CallSett /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteAddressRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteAddressRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteAddressRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -830,16 +932,22 @@ public override Address Get(GetAddressRequest request, gaxgrpc::CallSettings cal return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates an address resource in the specified project by using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertAddressRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertAddressRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertAddressRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -848,10 +956,13 @@ public override Operation Insert(InsertAddressRequest request, gaxgrpc::CallSett /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertAddressRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertAddressRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertAddressRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -914,4 +1025,18 @@ public partial class AddressList : gaxgrpc::IPageResponse
sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class Addresses + { + public partial class AddressesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/AutoscalersClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/AutoscalersClient.g.cs index e09ceac2c0b4..7152af2179d6 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/AutoscalersClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/AutoscalersClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -46,11 +47,15 @@ private AutoscalersSettings(AutoscalersSettings existing) : base(existing) gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); UpdateSettings = existing.UpdateSettings; + UpdateOperationsSettings = existing.UpdateOperationsSettings.Clone(); OnCopy(existing); } @@ -80,6 +85,24 @@ private AutoscalersSettings(AutoscalersSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to AutoscalersClient.Delete and + /// AutoscalersClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to AutoscalersClient.Get /// and AutoscalersClient.GetAsync. @@ -104,6 +127,24 @@ private AutoscalersSettings(AutoscalersSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to AutoscalersClient.Insert and + /// AutoscalersClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to AutoscalersClient.List /// and AutoscalersClient.ListAsync. @@ -128,6 +169,24 @@ private AutoscalersSettings(AutoscalersSettings existing) : base(existing) /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to AutoscalersClient.Patch and + /// AutoscalersClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to AutoscalersClient.Update /// and AutoscalersClient.UpdateAsync. @@ -140,6 +199,24 @@ private AutoscalersSettings(AutoscalersSettings existing) : base(existing) /// public gaxgrpc::CallSettings UpdateSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to AutoscalersClient.Update and + /// AutoscalersClient.UpdateAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings UpdateOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public AutoscalersSettings Clone() => new AutoscalersSettings(this); @@ -378,7 +455,7 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -387,7 +464,7 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -396,9 +473,35 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteAutoscalerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteAutoscalerRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified autoscaler. /// @@ -413,7 +516,7 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string zone, string autoscaler, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string zone, string autoscaler, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteAutoscalerRequest { Autoscaler = gax::GaxPreconditions.CheckNotNullOrEmpty(autoscaler, nameof(autoscaler)), @@ -435,7 +538,7 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string zone, string autoscaler, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string zone, string autoscaler, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteAutoscalerRequest { Autoscaler = gax::GaxPreconditions.CheckNotNullOrEmpty(autoscaler, nameof(autoscaler)), @@ -457,7 +560,7 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string zone, string autoscaler, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string zone, string autoscaler, st::CancellationToken cancellationToken) => DeleteAsync(project, zone, autoscaler, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -554,7 +657,7 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -563,7 +666,7 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -572,9 +675,35 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertAutoscalerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertAutoscalerRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates an autoscaler in the specified project using the data included in the request. /// @@ -589,7 +718,7 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string zone, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string zone, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertAutoscalerRequest { AutoscalerResource = gax::GaxPreconditions.CheckNotNull(autoscalerResource, nameof(autoscalerResource)), @@ -611,7 +740,7 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string zone, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string zone, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertAutoscalerRequest { AutoscalerResource = gax::GaxPreconditions.CheckNotNull(autoscalerResource, nameof(autoscalerResource)), @@ -633,7 +762,7 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string zone, Autoscaler autoscalerResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string zone, Autoscaler autoscalerResource, st::CancellationToken cancellationToken) => InsertAsync(project, zone, autoscalerResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -716,7 +845,7 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -725,7 +854,7 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -734,9 +863,35 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchAutoscalerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchAutoscalerRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// @@ -751,7 +906,7 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string zone, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string zone, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchAutoscalerRequest { AutoscalerResource = gax::GaxPreconditions.CheckNotNull(autoscalerResource, nameof(autoscalerResource)), @@ -773,7 +928,7 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string zone, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string zone, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchAutoscalerRequest { AutoscalerResource = gax::GaxPreconditions.CheckNotNull(autoscalerResource, nameof(autoscalerResource)), @@ -795,7 +950,7 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string zone, Autoscaler autoscalerResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string zone, Autoscaler autoscalerResource, st::CancellationToken cancellationToken) => PatchAsync(project, zone, autoscalerResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -804,7 +959,7 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(UpdateAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(UpdateAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -813,7 +968,7 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(UpdateAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -822,9 +977,35 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateAutoscalerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(UpdateAutoscalerRequest request, st::CancellationToken cancellationToken) => UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Update. + public virtual lro::OperationsClient UpdateOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Update. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceUpdate(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Update + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceUpdateAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + /// /// Updates an autoscaler in the specified project using the data included in the request. /// @@ -839,7 +1020,7 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(string project, string zone, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(string project, string zone, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => Update(new UpdateAutoscalerRequest { AutoscalerResource = gax::GaxPreconditions.CheckNotNull(autoscalerResource, nameof(autoscalerResource)), @@ -861,7 +1042,7 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string zone, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(string project, string zone, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => UpdateAsync(new UpdateAutoscalerRequest { AutoscalerResource = gax::GaxPreconditions.CheckNotNull(autoscalerResource, nameof(autoscalerResource)), @@ -883,7 +1064,7 @@ internal static AutoscalersClient Create(grpccore::CallInvoker callInvoker, Auto /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string zone, Autoscaler autoscalerResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(string project, string zone, Autoscaler autoscalerResource, st::CancellationToken cancellationToken) => UpdateAsync(project, zone, autoscalerResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -917,6 +1098,10 @@ public AutoscalersClientImpl(Autoscalers.AutoscalersClient grpcClient, Autoscale GrpcClient = grpcClient; AutoscalersSettings effectiveSettings = settings ?? AutoscalersSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.PatchOperationsSettings); + UpdateOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.UpdateOperationsSettings); _callAggregatedList = clientHelper.BuildApiCall(grpcClient.AggregatedListAsync, grpcClient.AggregatedList, effectiveSettings.AggregatedListSettings).WithGoogleRequestParam("project", request => request.Project); Modify_ApiCall(ref _callAggregatedList); Modify_AggregatedListApiCall(ref _callAggregatedList); @@ -1002,16 +1187,22 @@ public AutoscalersClientImpl(Autoscalers.AutoscalersClient grpcClient, Autoscale return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified autoscaler. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteAutoscalerRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1020,10 +1211,13 @@ public override Operation Delete(DeleteAutoscalerRequest request, gaxgrpc::CallS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteAutoscalerRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1050,16 +1244,22 @@ public override Autoscaler Get(GetAutoscalerRequest request, gaxgrpc::CallSettin return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates an autoscaler in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertAutoscalerRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1068,10 +1268,13 @@ public override Operation Insert(InsertAutoscalerRequest request, gaxgrpc::CallS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertAutoscalerRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1098,16 +1301,22 @@ public override Operation Insert(InsertAutoscalerRequest request, gaxgrpc::CallS return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchAutoscalerRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1116,22 +1325,31 @@ public override Operation Patch(PatchAutoscalerRequest request, gaxgrpc::CallSet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchAutoscalerRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } + /// The long-running operations client for Update. + public override lro::OperationsClient UpdateOperationsClient { get; } + /// /// Updates an autoscaler in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Update(UpdateAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Update(UpdateAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateAutoscalerRequest(ref request, ref callSettings); - return _callUpdate.Sync(request, callSettings); + Operation response = _callUpdate.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } /// @@ -1140,10 +1358,13 @@ public override Operation Update(UpdateAutoscalerRequest request, gaxgrpc::CallS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task UpdateAsync(UpdateAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> UpdateAsync(UpdateAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateAutoscalerRequest(ref request, ref callSettings); - return _callUpdate.Async(request, callSettings); + Operation response = await _callUpdate.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } } @@ -1182,4 +1403,18 @@ public partial class AutoscalerList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class Autoscalers + { + public partial class AutoscalersClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to ZoneOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForZoneOperations() => + ZoneOperations.ZoneOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/BackendBucketsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/BackendBucketsClient.g.cs index 89cffe89e424..3f6f7cddbae9 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/BackendBucketsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/BackendBucketsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,13 +46,19 @@ private BackendBucketsSettings(BackendBucketsSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AddSignedUrlKeySettings = existing.AddSignedUrlKeySettings; + AddSignedUrlKeyOperationsSettings = existing.AddSignedUrlKeyOperationsSettings.Clone(); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); DeleteSignedUrlKeySettings = existing.DeleteSignedUrlKeySettings; + DeleteSignedUrlKeyOperationsSettings = existing.DeleteSignedUrlKeyOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); UpdateSettings = existing.UpdateSettings; + UpdateOperationsSettings = existing.UpdateOperationsSettings.Clone(); OnCopy(existing); } @@ -69,6 +76,24 @@ private BackendBucketsSettings(BackendBucketsSettings existing) : base(existing) /// public gaxgrpc::CallSettings AddSignedUrlKeySettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to BackendBucketsClient.AddSignedUrlKey and + /// BackendBucketsClient.AddSignedUrlKeyAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings AddSignedUrlKeyOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to BackendBucketsClient.Delete /// and BackendBucketsClient.DeleteAsync. @@ -81,6 +106,24 @@ private BackendBucketsSettings(BackendBucketsSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to BackendBucketsClient.Delete and + /// BackendBucketsClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// BackendBucketsClient.DeleteSignedUrlKey and BackendBucketsClient.DeleteSignedUrlKeyAsync. @@ -93,6 +136,24 @@ private BackendBucketsSettings(BackendBucketsSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSignedUrlKeySettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to BackendBucketsClient.DeleteSignedUrlKey and + /// BackendBucketsClient.DeleteSignedUrlKeyAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteSignedUrlKeyOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to BackendBucketsClient.Get /// and BackendBucketsClient.GetAsync. @@ -117,6 +178,24 @@ private BackendBucketsSettings(BackendBucketsSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to BackendBucketsClient.Insert and + /// BackendBucketsClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to BackendBucketsClient.List /// and BackendBucketsClient.ListAsync. @@ -141,6 +220,24 @@ private BackendBucketsSettings(BackendBucketsSettings existing) : base(existing) /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to BackendBucketsClient.Patch and + /// BackendBucketsClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to BackendBucketsClient.Update /// and BackendBucketsClient.UpdateAsync. @@ -153,6 +250,24 @@ private BackendBucketsSettings(BackendBucketsSettings existing) : base(existing) /// public gaxgrpc::CallSettings UpdateSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to BackendBucketsClient.Update and + /// BackendBucketsClient.UpdateAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings UpdateOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public BackendBucketsSettings Clone() => new BackendBucketsSettings(this); @@ -322,7 +437,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddSignedUrlKey(AddSignedUrlKeyBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddSignedUrlKey(AddSignedUrlKeyBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -331,7 +446,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddSignedUrlKeyAsync(AddSignedUrlKeyBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddSignedUrlKeyAsync(AddSignedUrlKeyBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -340,9 +455,35 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddSignedUrlKeyAsync(AddSignedUrlKeyBackendBucketRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddSignedUrlKeyAsync(AddSignedUrlKeyBackendBucketRequest request, st::CancellationToken cancellationToken) => AddSignedUrlKeyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for AddSignedUrlKey. + public virtual lro::OperationsClient AddSignedUrlKeyOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of AddSignedUrlKey. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceAddSignedUrlKey(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddSignedUrlKeyOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// AddSignedUrlKey. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceAddSignedUrlKeyAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddSignedUrlKeyOperationsClient, callSettings); + /// /// Adds a key for validating requests with signed URLs for this backend bucket. /// @@ -357,7 +498,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddSignedUrlKey(string project, string backendBucket, SignedUrlKey signedUrlKeyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddSignedUrlKey(string project, string backendBucket, SignedUrlKey signedUrlKeyResource, gaxgrpc::CallSettings callSettings = null) => AddSignedUrlKey(new AddSignedUrlKeyBackendBucketRequest { BackendBucket = gax::GaxPreconditions.CheckNotNullOrEmpty(backendBucket, nameof(backendBucket)), @@ -379,7 +520,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddSignedUrlKeyAsync(string project, string backendBucket, SignedUrlKey signedUrlKeyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddSignedUrlKeyAsync(string project, string backendBucket, SignedUrlKey signedUrlKeyResource, gaxgrpc::CallSettings callSettings = null) => AddSignedUrlKeyAsync(new AddSignedUrlKeyBackendBucketRequest { BackendBucket = gax::GaxPreconditions.CheckNotNullOrEmpty(backendBucket, nameof(backendBucket)), @@ -401,7 +542,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddSignedUrlKeyAsync(string project, string backendBucket, SignedUrlKey signedUrlKeyResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddSignedUrlKeyAsync(string project, string backendBucket, SignedUrlKey signedUrlKeyResource, st::CancellationToken cancellationToken) => AddSignedUrlKeyAsync(project, backendBucket, signedUrlKeyResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -410,7 +551,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -419,7 +560,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -428,9 +569,35 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteBackendBucketRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteBackendBucketRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified BackendBucket resource. /// @@ -442,7 +609,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string backendBucket, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string backendBucket, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteBackendBucketRequest { BackendBucket = gax::GaxPreconditions.CheckNotNullOrEmpty(backendBucket, nameof(backendBucket)), @@ -460,7 +627,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string backendBucket, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string backendBucket, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteBackendBucketRequest { BackendBucket = gax::GaxPreconditions.CheckNotNullOrEmpty(backendBucket, nameof(backendBucket)), @@ -478,7 +645,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string backendBucket, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string backendBucket, st::CancellationToken cancellationToken) => DeleteAsync(project, backendBucket, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -487,7 +654,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DeleteSignedUrlKey(DeleteSignedUrlKeyBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DeleteSignedUrlKey(DeleteSignedUrlKeyBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -496,7 +663,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteSignedUrlKeyAsync(DeleteSignedUrlKeyBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteSignedUrlKeyAsync(DeleteSignedUrlKeyBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -505,9 +672,36 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteSignedUrlKeyAsync(DeleteSignedUrlKeyBackendBucketRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteSignedUrlKeyAsync(DeleteSignedUrlKeyBackendBucketRequest request, st::CancellationToken cancellationToken) => DeleteSignedUrlKeyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for DeleteSignedUrlKey. + public virtual lro::OperationsClient DeleteSignedUrlKeyOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of DeleteSignedUrlKey + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDeleteSignedUrlKey(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteSignedUrlKeyOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// DeleteSignedUrlKey. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteSignedUrlKeyAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteSignedUrlKeyOperationsClient, callSettings); + /// /// Deletes a key for validating requests with signed URLs for this backend bucket. /// @@ -522,7 +716,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DeleteSignedUrlKey(string project, string backendBucket, string keyName, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DeleteSignedUrlKey(string project, string backendBucket, string keyName, gaxgrpc::CallSettings callSettings = null) => DeleteSignedUrlKey(new DeleteSignedUrlKeyBackendBucketRequest { BackendBucket = gax::GaxPreconditions.CheckNotNullOrEmpty(backendBucket, nameof(backendBucket)), @@ -544,7 +738,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteSignedUrlKeyAsync(string project, string backendBucket, string keyName, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteSignedUrlKeyAsync(string project, string backendBucket, string keyName, gaxgrpc::CallSettings callSettings = null) => DeleteSignedUrlKeyAsync(new DeleteSignedUrlKeyBackendBucketRequest { BackendBucket = gax::GaxPreconditions.CheckNotNullOrEmpty(backendBucket, nameof(backendBucket)), @@ -566,7 +760,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteSignedUrlKeyAsync(string project, string backendBucket, string keyName, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteSignedUrlKeyAsync(string project, string backendBucket, string keyName, st::CancellationToken cancellationToken) => DeleteSignedUrlKeyAsync(project, backendBucket, keyName, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -652,7 +846,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -661,7 +855,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -670,9 +864,35 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertBackendBucketRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertBackendBucketRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a BackendBucket resource in the specified project using the data included in the request. /// @@ -684,7 +904,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, BackendBucket backendBucketResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, BackendBucket backendBucketResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertBackendBucketRequest { BackendBucketResource = gax::GaxPreconditions.CheckNotNull(backendBucketResource, nameof(backendBucketResource)), @@ -702,7 +922,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, BackendBucket backendBucketResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, BackendBucket backendBucketResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertBackendBucketRequest { BackendBucketResource = gax::GaxPreconditions.CheckNotNull(backendBucketResource, nameof(backendBucketResource)), @@ -720,7 +940,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, BackendBucket backendBucketResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, BackendBucket backendBucketResource, st::CancellationToken cancellationToken) => InsertAsync(project, backendBucketResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -795,7 +1015,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -804,7 +1024,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -813,9 +1033,35 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchBackendBucketRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchBackendBucketRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// @@ -830,7 +1076,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string backendBucket, BackendBucket backendBucketResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string backendBucket, BackendBucket backendBucketResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchBackendBucketRequest { BackendBucket = gax::GaxPreconditions.CheckNotNullOrEmpty(backendBucket, nameof(backendBucket)), @@ -852,7 +1098,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string backendBucket, BackendBucket backendBucketResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string backendBucket, BackendBucket backendBucketResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchBackendBucketRequest { BackendBucket = gax::GaxPreconditions.CheckNotNullOrEmpty(backendBucket, nameof(backendBucket)), @@ -874,7 +1120,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string backendBucket, BackendBucket backendBucketResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string backendBucket, BackendBucket backendBucketResource, st::CancellationToken cancellationToken) => PatchAsync(project, backendBucket, backendBucketResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -883,7 +1129,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(UpdateBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(UpdateBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -892,7 +1138,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(UpdateBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -901,9 +1147,35 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateBackendBucketRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(UpdateBackendBucketRequest request, st::CancellationToken cancellationToken) => UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Update. + public virtual lro::OperationsClient UpdateOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Update. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceUpdate(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Update + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceUpdateAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + /// /// Updates the specified BackendBucket resource with the data included in the request. /// @@ -918,7 +1190,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(string project, string backendBucket, BackendBucket backendBucketResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(string project, string backendBucket, BackendBucket backendBucketResource, gaxgrpc::CallSettings callSettings = null) => Update(new UpdateBackendBucketRequest { BackendBucket = gax::GaxPreconditions.CheckNotNullOrEmpty(backendBucket, nameof(backendBucket)), @@ -940,7 +1212,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string backendBucket, BackendBucket backendBucketResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(string project, string backendBucket, BackendBucket backendBucketResource, gaxgrpc::CallSettings callSettings = null) => UpdateAsync(new UpdateBackendBucketRequest { BackendBucket = gax::GaxPreconditions.CheckNotNullOrEmpty(backendBucket, nameof(backendBucket)), @@ -962,7 +1234,7 @@ internal static BackendBucketsClient Create(grpccore::CallInvoker callInvoker, B /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string backendBucket, BackendBucket backendBucketResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(string project, string backendBucket, BackendBucket backendBucketResource, st::CancellationToken cancellationToken) => UpdateAsync(project, backendBucket, backendBucketResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -998,6 +1270,12 @@ public BackendBucketsClientImpl(BackendBuckets.BackendBucketsClient grpcClient, GrpcClient = grpcClient; BackendBucketsSettings effectiveSettings = settings ?? BackendBucketsSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + AddSignedUrlKeyOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.AddSignedUrlKeyOperationsSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + DeleteSignedUrlKeyOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteSignedUrlKeyOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.PatchOperationsSettings); + UpdateOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.UpdateOperationsSettings); _callAddSignedUrlKey = clientHelper.BuildApiCall(grpcClient.AddSignedUrlKeyAsync, grpcClient.AddSignedUrlKey, effectiveSettings.AddSignedUrlKeySettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("backend_bucket", request => request.BackendBucket); Modify_ApiCall(ref _callAddSignedUrlKey); Modify_AddSignedUrlKeyApiCall(ref _callAddSignedUrlKey); @@ -1064,16 +1342,22 @@ public BackendBucketsClientImpl(BackendBuckets.BackendBucketsClient grpcClient, partial void Modify_UpdateBackendBucketRequest(ref UpdateBackendBucketRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for AddSignedUrlKey. + public override lro::OperationsClient AddSignedUrlKeyOperationsClient { get; } + /// /// Adds a key for validating requests with signed URLs for this backend bucket. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation AddSignedUrlKey(AddSignedUrlKeyBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation AddSignedUrlKey(AddSignedUrlKeyBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddSignedUrlKeyBackendBucketRequest(ref request, ref callSettings); - return _callAddSignedUrlKey.Sync(request, callSettings); + Operation response = _callAddSignedUrlKey.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddSignedUrlKeyOperationsClient); } /// @@ -1082,22 +1366,31 @@ public override Operation AddSignedUrlKey(AddSignedUrlKeyBackendBucketRequest re /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task AddSignedUrlKeyAsync(AddSignedUrlKeyBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> AddSignedUrlKeyAsync(AddSignedUrlKeyBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddSignedUrlKeyBackendBucketRequest(ref request, ref callSettings); - return _callAddSignedUrlKey.Async(request, callSettings); + Operation response = await _callAddSignedUrlKey.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddSignedUrlKeyOperationsClient); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified BackendBucket resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteBackendBucketRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1106,22 +1399,31 @@ public override Operation Delete(DeleteBackendBucketRequest request, gaxgrpc::Ca /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteBackendBucketRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } + /// The long-running operations client for DeleteSignedUrlKey. + public override lro::OperationsClient DeleteSignedUrlKeyOperationsClient { get; } + /// /// Deletes a key for validating requests with signed URLs for this backend bucket. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation DeleteSignedUrlKey(DeleteSignedUrlKeyBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation DeleteSignedUrlKey(DeleteSignedUrlKeyBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteSignedUrlKeyBackendBucketRequest(ref request, ref callSettings); - return _callDeleteSignedUrlKey.Sync(request, callSettings); + Operation response = _callDeleteSignedUrlKey.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteSignedUrlKeyOperationsClient); } /// @@ -1130,10 +1432,13 @@ public override Operation DeleteSignedUrlKey(DeleteSignedUrlKeyBackendBucketRequ /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteSignedUrlKeyAsync(DeleteSignedUrlKeyBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteSignedUrlKeyAsync(DeleteSignedUrlKeyBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteSignedUrlKeyBackendBucketRequest(ref request, ref callSettings); - return _callDeleteSignedUrlKey.Async(request, callSettings); + Operation response = await _callDeleteSignedUrlKey.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteSignedUrlKeyOperationsClient); } /// @@ -1160,16 +1465,22 @@ public override BackendBucket Get(GetBackendBucketRequest request, gaxgrpc::Call return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a BackendBucket resource in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertBackendBucketRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1178,10 +1489,13 @@ public override Operation Insert(InsertBackendBucketRequest request, gaxgrpc::Ca /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertBackendBucketRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1208,16 +1522,22 @@ public override Operation Insert(InsertBackendBucketRequest request, gaxgrpc::Ca return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchBackendBucketRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1226,22 +1546,31 @@ public override Operation Patch(PatchBackendBucketRequest request, gaxgrpc::Call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchBackendBucketRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } + /// The long-running operations client for Update. + public override lro::OperationsClient UpdateOperationsClient { get; } + /// /// Updates the specified BackendBucket resource with the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Update(UpdateBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Update(UpdateBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateBackendBucketRequest(ref request, ref callSettings); - return _callUpdate.Sync(request, callSettings); + Operation response = _callUpdate.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } /// @@ -1250,10 +1579,13 @@ public override Operation Update(UpdateBackendBucketRequest request, gaxgrpc::Ca /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task UpdateAsync(UpdateBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> UpdateAsync(UpdateBackendBucketRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateBackendBucketRequest(ref request, ref callSettings); - return _callUpdate.Async(request, callSettings); + Operation response = await _callUpdate.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } } @@ -1274,4 +1606,18 @@ public partial class BackendBucketList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class BackendBuckets + { + public partial class BackendBucketsClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/BackendServicesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/BackendServicesClient.g.cs index 5c4c6808f774..5bc525ec93a7 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/BackendServicesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/BackendServicesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,16 +46,23 @@ private BackendServicesSettings(BackendServicesSettings existing) : base(existin { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AddSignedUrlKeySettings = existing.AddSignedUrlKeySettings; + AddSignedUrlKeyOperationsSettings = existing.AddSignedUrlKeyOperationsSettings.Clone(); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); DeleteSignedUrlKeySettings = existing.DeleteSignedUrlKeySettings; + DeleteSignedUrlKeyOperationsSettings = existing.DeleteSignedUrlKeyOperationsSettings.Clone(); GetSettings = existing.GetSettings; GetHealthSettings = existing.GetHealthSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); SetSecurityPolicySettings = existing.SetSecurityPolicySettings; + SetSecurityPolicyOperationsSettings = existing.SetSecurityPolicyOperationsSettings.Clone(); UpdateSettings = existing.UpdateSettings; + UpdateOperationsSettings = existing.UpdateOperationsSettings.Clone(); OnCopy(existing); } @@ -72,6 +80,24 @@ private BackendServicesSettings(BackendServicesSettings existing) : base(existin /// public gaxgrpc::CallSettings AddSignedUrlKeySettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to BackendServicesClient.AddSignedUrlKey and + /// BackendServicesClient.AddSignedUrlKeyAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings AddSignedUrlKeyOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// BackendServicesClient.AggregatedList and BackendServicesClient.AggregatedListAsync. @@ -96,6 +122,24 @@ private BackendServicesSettings(BackendServicesSettings existing) : base(existin /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to BackendServicesClient.Delete and + /// BackendServicesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// BackendServicesClient.DeleteSignedUrlKey and BackendServicesClient.DeleteSignedUrlKeyAsync. @@ -108,6 +152,24 @@ private BackendServicesSettings(BackendServicesSettings existing) : base(existin /// public gaxgrpc::CallSettings DeleteSignedUrlKeySettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to BackendServicesClient.DeleteSignedUrlKey and + /// BackendServicesClient.DeleteSignedUrlKeyAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteSignedUrlKeyOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to BackendServicesClient.Get /// and BackendServicesClient.GetAsync. @@ -144,6 +206,24 @@ private BackendServicesSettings(BackendServicesSettings existing) : base(existin /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to BackendServicesClient.Insert and + /// BackendServicesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to BackendServicesClient.List /// and BackendServicesClient.ListAsync. @@ -168,6 +248,24 @@ private BackendServicesSettings(BackendServicesSettings existing) : base(existin /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to BackendServicesClient.Patch and + /// BackendServicesClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// BackendServicesClient.SetSecurityPolicy and BackendServicesClient.SetSecurityPolicyAsync. @@ -180,6 +278,24 @@ private BackendServicesSettings(BackendServicesSettings existing) : base(existin /// public gaxgrpc::CallSettings SetSecurityPolicySettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to BackendServicesClient.SetSecurityPolicy and + /// BackendServicesClient.SetSecurityPolicyAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetSecurityPolicyOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// BackendServicesClient.Update and BackendServicesClient.UpdateAsync. @@ -192,6 +308,24 @@ private BackendServicesSettings(BackendServicesSettings existing) : base(existin /// public gaxgrpc::CallSettings UpdateSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to BackendServicesClient.Update and + /// BackendServicesClient.UpdateAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings UpdateOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public BackendServicesSettings Clone() => new BackendServicesSettings(this); @@ -361,7 +495,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddSignedUrlKey(AddSignedUrlKeyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddSignedUrlKey(AddSignedUrlKeyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -370,7 +504,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddSignedUrlKeyAsync(AddSignedUrlKeyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddSignedUrlKeyAsync(AddSignedUrlKeyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -379,9 +513,35 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddSignedUrlKeyAsync(AddSignedUrlKeyBackendServiceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddSignedUrlKeyAsync(AddSignedUrlKeyBackendServiceRequest request, st::CancellationToken cancellationToken) => AddSignedUrlKeyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for AddSignedUrlKey. + public virtual lro::OperationsClient AddSignedUrlKeyOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of AddSignedUrlKey. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceAddSignedUrlKey(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddSignedUrlKeyOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// AddSignedUrlKey. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceAddSignedUrlKeyAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddSignedUrlKeyOperationsClient, callSettings); + /// /// Adds a key for validating requests with signed URLs for this backend service. /// @@ -396,7 +556,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddSignedUrlKey(string project, string backendService, SignedUrlKey signedUrlKeyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddSignedUrlKey(string project, string backendService, SignedUrlKey signedUrlKeyResource, gaxgrpc::CallSettings callSettings = null) => AddSignedUrlKey(new AddSignedUrlKeyBackendServiceRequest { BackendService = gax::GaxPreconditions.CheckNotNullOrEmpty(backendService, nameof(backendService)), @@ -418,7 +578,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddSignedUrlKeyAsync(string project, string backendService, SignedUrlKey signedUrlKeyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddSignedUrlKeyAsync(string project, string backendService, SignedUrlKey signedUrlKeyResource, gaxgrpc::CallSettings callSettings = null) => AddSignedUrlKeyAsync(new AddSignedUrlKeyBackendServiceRequest { BackendService = gax::GaxPreconditions.CheckNotNullOrEmpty(backendService, nameof(backendService)), @@ -440,7 +600,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddSignedUrlKeyAsync(string project, string backendService, SignedUrlKey signedUrlKeyResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddSignedUrlKeyAsync(string project, string backendService, SignedUrlKey signedUrlKeyResource, st::CancellationToken cancellationToken) => AddSignedUrlKeyAsync(project, backendService, signedUrlKeyResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -519,7 +679,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -528,7 +688,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -537,9 +697,35 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteBackendServiceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteBackendServiceRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified BackendService resource. /// @@ -551,7 +737,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string backendService, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string backendService, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteBackendServiceRequest { BackendService = gax::GaxPreconditions.CheckNotNullOrEmpty(backendService, nameof(backendService)), @@ -569,7 +755,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string backendService, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string backendService, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteBackendServiceRequest { BackendService = gax::GaxPreconditions.CheckNotNullOrEmpty(backendService, nameof(backendService)), @@ -587,7 +773,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string backendService, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string backendService, st::CancellationToken cancellationToken) => DeleteAsync(project, backendService, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -596,7 +782,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DeleteSignedUrlKey(DeleteSignedUrlKeyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DeleteSignedUrlKey(DeleteSignedUrlKeyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -605,7 +791,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteSignedUrlKeyAsync(DeleteSignedUrlKeyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteSignedUrlKeyAsync(DeleteSignedUrlKeyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -614,9 +800,36 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteSignedUrlKeyAsync(DeleteSignedUrlKeyBackendServiceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteSignedUrlKeyAsync(DeleteSignedUrlKeyBackendServiceRequest request, st::CancellationToken cancellationToken) => DeleteSignedUrlKeyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for DeleteSignedUrlKey. + public virtual lro::OperationsClient DeleteSignedUrlKeyOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of DeleteSignedUrlKey + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDeleteSignedUrlKey(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteSignedUrlKeyOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// DeleteSignedUrlKey. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteSignedUrlKeyAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteSignedUrlKeyOperationsClient, callSettings); + /// /// Deletes a key for validating requests with signed URLs for this backend service. /// @@ -631,7 +844,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DeleteSignedUrlKey(string project, string backendService, string keyName, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DeleteSignedUrlKey(string project, string backendService, string keyName, gaxgrpc::CallSettings callSettings = null) => DeleteSignedUrlKey(new DeleteSignedUrlKeyBackendServiceRequest { BackendService = gax::GaxPreconditions.CheckNotNullOrEmpty(backendService, nameof(backendService)), @@ -653,7 +866,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteSignedUrlKeyAsync(string project, string backendService, string keyName, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteSignedUrlKeyAsync(string project, string backendService, string keyName, gaxgrpc::CallSettings callSettings = null) => DeleteSignedUrlKeyAsync(new DeleteSignedUrlKeyBackendServiceRequest { BackendService = gax::GaxPreconditions.CheckNotNullOrEmpty(backendService, nameof(backendService)), @@ -675,7 +888,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteSignedUrlKeyAsync(string project, string backendService, string keyName, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteSignedUrlKeyAsync(string project, string backendService, string keyName, st::CancellationToken cancellationToken) => DeleteSignedUrlKeyAsync(project, backendService, keyName, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -870,7 +1083,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -879,7 +1092,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -888,9 +1101,35 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertBackendServiceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertBackendServiceRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview. /// @@ -902,7 +1141,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertBackendServiceRequest { BackendServiceResource = gax::GaxPreconditions.CheckNotNull(backendServiceResource, nameof(backendServiceResource)), @@ -920,7 +1159,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertBackendServiceRequest { BackendServiceResource = gax::GaxPreconditions.CheckNotNull(backendServiceResource, nameof(backendServiceResource)), @@ -938,7 +1177,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, BackendService backendServiceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, BackendService backendServiceResource, st::CancellationToken cancellationToken) => InsertAsync(project, backendServiceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1013,7 +1252,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1022,7 +1261,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1031,9 +1270,35 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchBackendServiceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchBackendServiceRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Patches the specified BackendService resource with the data included in the request. For more information, see Backend services overview. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// @@ -1048,7 +1313,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string backendService, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string backendService, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchBackendServiceRequest { BackendService = gax::GaxPreconditions.CheckNotNullOrEmpty(backendService, nameof(backendService)), @@ -1070,7 +1335,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string backendService, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string backendService, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchBackendServiceRequest { BackendService = gax::GaxPreconditions.CheckNotNullOrEmpty(backendService, nameof(backendService)), @@ -1092,7 +1357,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string backendService, BackendService backendServiceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string backendService, BackendService backendServiceResource, st::CancellationToken cancellationToken) => PatchAsync(project, backendService, backendServiceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1101,7 +1366,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetSecurityPolicy(SetSecurityPolicyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetSecurityPolicy(SetSecurityPolicyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1110,7 +1375,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetSecurityPolicyAsync(SetSecurityPolicyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetSecurityPolicyAsync(SetSecurityPolicyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1119,9 +1384,36 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetSecurityPolicyAsync(SetSecurityPolicyBackendServiceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetSecurityPolicyAsync(SetSecurityPolicyBackendServiceRequest request, st::CancellationToken cancellationToken) => SetSecurityPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetSecurityPolicy. + public virtual lro::OperationsClient SetSecurityPolicyOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetSecurityPolicy + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetSecurityPolicy(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetSecurityPolicyOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetSecurityPolicy. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetSecurityPolicyAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetSecurityPolicyOperationsClient, callSettings); + /// /// Sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor Overview /// @@ -1136,7 +1428,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetSecurityPolicy(string project, string backendService, SecurityPolicyReference securityPolicyReferenceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetSecurityPolicy(string project, string backendService, SecurityPolicyReference securityPolicyReferenceResource, gaxgrpc::CallSettings callSettings = null) => SetSecurityPolicy(new SetSecurityPolicyBackendServiceRequest { BackendService = gax::GaxPreconditions.CheckNotNullOrEmpty(backendService, nameof(backendService)), @@ -1158,7 +1450,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetSecurityPolicyAsync(string project, string backendService, SecurityPolicyReference securityPolicyReferenceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetSecurityPolicyAsync(string project, string backendService, SecurityPolicyReference securityPolicyReferenceResource, gaxgrpc::CallSettings callSettings = null) => SetSecurityPolicyAsync(new SetSecurityPolicyBackendServiceRequest { BackendService = gax::GaxPreconditions.CheckNotNullOrEmpty(backendService, nameof(backendService)), @@ -1180,7 +1472,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetSecurityPolicyAsync(string project, string backendService, SecurityPolicyReference securityPolicyReferenceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetSecurityPolicyAsync(string project, string backendService, SecurityPolicyReference securityPolicyReferenceResource, st::CancellationToken cancellationToken) => SetSecurityPolicyAsync(project, backendService, securityPolicyReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1189,7 +1481,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(UpdateBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(UpdateBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1198,7 +1490,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(UpdateBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1207,9 +1499,35 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateBackendServiceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(UpdateBackendServiceRequest request, st::CancellationToken cancellationToken) => UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Update. + public virtual lro::OperationsClient UpdateOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Update. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceUpdate(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Update + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceUpdateAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + /// /// Updates the specified BackendService resource with the data included in the request. For more information, see Backend services overview. /// @@ -1224,7 +1542,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(string project, string backendService, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(string project, string backendService, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => Update(new UpdateBackendServiceRequest { BackendService = gax::GaxPreconditions.CheckNotNullOrEmpty(backendService, nameof(backendService)), @@ -1246,7 +1564,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string backendService, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(string project, string backendService, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => UpdateAsync(new UpdateBackendServiceRequest { BackendService = gax::GaxPreconditions.CheckNotNullOrEmpty(backendService, nameof(backendService)), @@ -1268,7 +1586,7 @@ internal static BackendServicesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string backendService, BackendService backendServiceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(string project, string backendService, BackendService backendServiceResource, st::CancellationToken cancellationToken) => UpdateAsync(project, backendService, backendServiceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -1310,6 +1628,13 @@ public BackendServicesClientImpl(BackendServices.BackendServicesClient grpcClien GrpcClient = grpcClient; BackendServicesSettings effectiveSettings = settings ?? BackendServicesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + AddSignedUrlKeyOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.AddSignedUrlKeyOperationsSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + DeleteSignedUrlKeyOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteSignedUrlKeyOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.PatchOperationsSettings); + SetSecurityPolicyOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.SetSecurityPolicyOperationsSettings); + UpdateOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.UpdateOperationsSettings); _callAddSignedUrlKey = clientHelper.BuildApiCall(grpcClient.AddSignedUrlKeyAsync, grpcClient.AddSignedUrlKey, effectiveSettings.AddSignedUrlKeySettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("backend_service", request => request.BackendService); Modify_ApiCall(ref _callAddSignedUrlKey); Modify_AddSignedUrlKeyApiCall(ref _callAddSignedUrlKey); @@ -1397,16 +1722,22 @@ public BackendServicesClientImpl(BackendServices.BackendServicesClient grpcClien partial void Modify_UpdateBackendServiceRequest(ref UpdateBackendServiceRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for AddSignedUrlKey. + public override lro::OperationsClient AddSignedUrlKeyOperationsClient { get; } + /// /// Adds a key for validating requests with signed URLs for this backend service. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation AddSignedUrlKey(AddSignedUrlKeyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation AddSignedUrlKey(AddSignedUrlKeyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddSignedUrlKeyBackendServiceRequest(ref request, ref callSettings); - return _callAddSignedUrlKey.Sync(request, callSettings); + Operation response = _callAddSignedUrlKey.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddSignedUrlKeyOperationsClient); } /// @@ -1415,10 +1746,13 @@ public override Operation AddSignedUrlKey(AddSignedUrlKeyBackendServiceRequest r /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task AddSignedUrlKeyAsync(AddSignedUrlKeyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> AddSignedUrlKeyAsync(AddSignedUrlKeyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddSignedUrlKeyBackendServiceRequest(ref request, ref callSettings); - return _callAddSignedUrlKey.Async(request, callSettings); + Operation response = await _callAddSignedUrlKey.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddSignedUrlKeyOperationsClient); } /// @@ -1447,16 +1781,22 @@ public override Operation AddSignedUrlKey(AddSignedUrlKeyBackendServiceRequest r return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified BackendService resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteBackendServiceRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1465,22 +1805,31 @@ public override Operation Delete(DeleteBackendServiceRequest request, gaxgrpc::C /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteBackendServiceRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } + /// The long-running operations client for DeleteSignedUrlKey. + public override lro::OperationsClient DeleteSignedUrlKeyOperationsClient { get; } + /// /// Deletes a key for validating requests with signed URLs for this backend service. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation DeleteSignedUrlKey(DeleteSignedUrlKeyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation DeleteSignedUrlKey(DeleteSignedUrlKeyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteSignedUrlKeyBackendServiceRequest(ref request, ref callSettings); - return _callDeleteSignedUrlKey.Sync(request, callSettings); + Operation response = _callDeleteSignedUrlKey.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteSignedUrlKeyOperationsClient); } /// @@ -1489,10 +1838,13 @@ public override Operation DeleteSignedUrlKey(DeleteSignedUrlKeyBackendServiceReq /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteSignedUrlKeyAsync(DeleteSignedUrlKeyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteSignedUrlKeyAsync(DeleteSignedUrlKeyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteSignedUrlKeyBackendServiceRequest(ref request, ref callSettings); - return _callDeleteSignedUrlKey.Async(request, callSettings); + Operation response = await _callDeleteSignedUrlKey.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteSignedUrlKeyOperationsClient); } /// @@ -1551,16 +1903,22 @@ public override BackendServiceGroupHealth GetHealth(GetHealthBackendServiceReque return _callGetHealth.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertBackendServiceRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1569,10 +1927,13 @@ public override Operation Insert(InsertBackendServiceRequest request, gaxgrpc::C /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertBackendServiceRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1599,16 +1960,22 @@ public override Operation Insert(InsertBackendServiceRequest request, gaxgrpc::C return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Patches the specified BackendService resource with the data included in the request. For more information, see Backend services overview. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchBackendServiceRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1617,22 +1984,31 @@ public override Operation Patch(PatchBackendServiceRequest request, gaxgrpc::Cal /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchBackendServiceRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } + /// The long-running operations client for SetSecurityPolicy. + public override lro::OperationsClient SetSecurityPolicyOperationsClient { get; } + /// /// Sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor Overview /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetSecurityPolicy(SetSecurityPolicyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetSecurityPolicy(SetSecurityPolicyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetSecurityPolicyBackendServiceRequest(ref request, ref callSettings); - return _callSetSecurityPolicy.Sync(request, callSettings); + Operation response = _callSetSecurityPolicy.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetSecurityPolicyOperationsClient); } /// @@ -1641,22 +2017,31 @@ public override Operation SetSecurityPolicy(SetSecurityPolicyBackendServiceReque /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetSecurityPolicyAsync(SetSecurityPolicyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetSecurityPolicyAsync(SetSecurityPolicyBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetSecurityPolicyBackendServiceRequest(ref request, ref callSettings); - return _callSetSecurityPolicy.Async(request, callSettings); + Operation response = await _callSetSecurityPolicy.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetSecurityPolicyOperationsClient); } + /// The long-running operations client for Update. + public override lro::OperationsClient UpdateOperationsClient { get; } + /// /// Updates the specified BackendService resource with the data included in the request. For more information, see Backend services overview. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Update(UpdateBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Update(UpdateBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateBackendServiceRequest(ref request, ref callSettings); - return _callUpdate.Sync(request, callSettings); + Operation response = _callUpdate.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } /// @@ -1665,10 +2050,13 @@ public override Operation Update(UpdateBackendServiceRequest request, gaxgrpc::C /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task UpdateAsync(UpdateBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> UpdateAsync(UpdateBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateBackendServiceRequest(ref request, ref callSettings); - return _callUpdate.Async(request, callSettings); + Operation response = await _callUpdate.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } } @@ -1708,4 +2096,18 @@ public partial class BackendServiceList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class BackendServices + { + public partial class BackendServicesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ComputeLroAdaptation.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ComputeLroAdaptation.g.cs new file mode 100644 index 000000000000..1e2da215fdba --- /dev/null +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ComputeLroAdaptation.g.cs @@ -0,0 +1,2313 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated code. DO NOT EDIT! + +using gax = Google.Api.Gax; +using lro = Google.LongRunning; + +namespace Google.Cloud.Compute.V1 +{ + public partial class DeleteAddressRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertAddressRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteAutoscalerRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class InsertAutoscalerRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class PatchAutoscalerRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class UpdateAutoscalerRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class AddSignedUrlKeyBackendBucketRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeleteBackendBucketRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeleteSignedUrlKeyBackendBucketRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertBackendBucketRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class PatchBackendBucketRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class UpdateBackendBucketRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class AddSignedUrlKeyBackendServiceRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeleteBackendServiceRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeleteSignedUrlKeyBackendServiceRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertBackendServiceRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class PatchBackendServiceRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class SetSecurityPolicyBackendServiceRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class UpdateBackendServiceRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class AddResourcePoliciesDiskRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class CreateSnapshotDiskRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class DeleteDiskRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class InsertDiskRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class RemoveResourcePoliciesDiskRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class ResizeDiskRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class SetLabelsDiskRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class DeleteExternalVpnGatewayRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertExternalVpnGatewayRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class SetLabelsExternalVpnGatewayRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class AddAssociationFirewallPolicyRequest + { + internal void PopulatePollRequestFields(GetGlobalOrganizationOperationRequest pollRequest) + { + } + } + + public partial class AddRuleFirewallPolicyRequest + { + internal void PopulatePollRequestFields(GetGlobalOrganizationOperationRequest pollRequest) + { + } + } + + public partial class CloneRulesFirewallPolicyRequest + { + internal void PopulatePollRequestFields(GetGlobalOrganizationOperationRequest pollRequest) + { + } + } + + public partial class DeleteFirewallPolicyRequest + { + internal void PopulatePollRequestFields(GetGlobalOrganizationOperationRequest pollRequest) + { + } + } + + public partial class InsertFirewallPolicyRequest + { + internal void PopulatePollRequestFields(GetGlobalOrganizationOperationRequest pollRequest) => + pollRequest.ParentId = ParentId; + } + + public partial class MoveFirewallPolicyRequest + { + internal void PopulatePollRequestFields(GetGlobalOrganizationOperationRequest pollRequest) => + pollRequest.ParentId = ParentId; + } + + public partial class PatchFirewallPolicyRequest + { + internal void PopulatePollRequestFields(GetGlobalOrganizationOperationRequest pollRequest) + { + } + } + + public partial class PatchRuleFirewallPolicyRequest + { + internal void PopulatePollRequestFields(GetGlobalOrganizationOperationRequest pollRequest) + { + } + } + + public partial class RemoveAssociationFirewallPolicyRequest + { + internal void PopulatePollRequestFields(GetGlobalOrganizationOperationRequest pollRequest) + { + } + } + + public partial class RemoveRuleFirewallPolicyRequest + { + internal void PopulatePollRequestFields(GetGlobalOrganizationOperationRequest pollRequest) + { + } + } + + public partial class DeleteFirewallRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertFirewallRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class PatchFirewallRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class UpdateFirewallRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeleteForwardingRuleRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertForwardingRuleRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class PatchForwardingRuleRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class SetLabelsForwardingRuleRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class SetTargetForwardingRuleRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteGlobalAddressRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertGlobalAddressRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeleteGlobalForwardingRuleRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertGlobalForwardingRuleRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class PatchGlobalForwardingRuleRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class SetLabelsGlobalForwardingRuleRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class SetTargetGlobalForwardingRuleRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeleteGlobalNetworkEndpointGroupRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertGlobalNetworkEndpointGroupRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeleteGlobalPublicDelegatedPrefixeRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertGlobalPublicDelegatedPrefixeRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class PatchGlobalPublicDelegatedPrefixeRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeleteHealthCheckRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertHealthCheckRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class PatchHealthCheckRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class UpdateHealthCheckRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeleteImageRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeprecateImageRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertImageRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class PatchImageRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class SetLabelsImageRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class AbandonInstancesInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class ApplyUpdatesToInstancesInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class CreateInstancesInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class DeleteInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class DeleteInstancesInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class DeletePerInstanceConfigsInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class InsertInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class PatchInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class PatchPerInstanceConfigsInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class RecreateInstancesInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class ResizeInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class SetInstanceTemplateInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class SetTargetPoolsInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class UpdatePerInstanceConfigsInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class AddInstancesInstanceGroupRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class DeleteInstanceGroupRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class InsertInstanceGroupRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class RemoveInstancesInstanceGroupRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class SetNamedPortsInstanceGroupRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class DeleteInstanceTemplateRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertInstanceTemplateRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class AddAccessConfigInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class AddResourcePoliciesInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class AttachDiskInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class BulkInsertInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class DeleteInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class DeleteAccessConfigInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class DetachDiskInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class InsertInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class RemoveResourcePoliciesInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class ResetInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class SetDeletionProtectionInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class SetDiskAutoDeleteInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class SetLabelsInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class SetMachineResourcesInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class SetMachineTypeInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class SetMetadataInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class SetMinCpuPlatformInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class SetSchedulingInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class SetServiceAccountInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class SetShieldedInstanceIntegrityPolicyInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class SetTagsInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class SimulateMaintenanceEventInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class StartInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class StartWithEncryptionKeyInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class StopInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class UpdateInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class UpdateAccessConfigInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class UpdateDisplayDeviceInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class UpdateNetworkInterfaceInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class UpdateShieldedInstanceConfigInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class DeleteInterconnectAttachmentRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertInterconnectAttachmentRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class PatchInterconnectAttachmentRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteInterconnectRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertInterconnectRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class PatchInterconnectRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeleteLicenseRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertLicenseRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class AttachNetworkEndpointsNetworkEndpointGroupRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class DeleteNetworkEndpointGroupRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class DetachNetworkEndpointsNetworkEndpointGroupRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class InsertNetworkEndpointGroupRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class AddPeeringNetworkRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeleteNetworkRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertNetworkRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class PatchNetworkRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class RemovePeeringNetworkRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class SwitchToCustomModeNetworkRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class UpdatePeeringNetworkRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class AddNodesNodeGroupRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class DeleteNodeGroupRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class DeleteNodesNodeGroupRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class InsertNodeGroupRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class PatchNodeGroupRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class SetNodeTemplateNodeGroupRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class DeleteNodeTemplateRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertNodeTemplateRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeletePacketMirroringRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertPacketMirroringRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class PatchPacketMirroringRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DisableXpnHostProjectRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DisableXpnResourceProjectRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class EnableXpnHostProjectRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class EnableXpnResourceProjectRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class MoveDiskProjectRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class MoveInstanceProjectRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class SetCommonInstanceMetadataProjectRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class SetDefaultNetworkTierProjectRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class SetUsageExportBucketProjectRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeletePublicAdvertisedPrefixeRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertPublicAdvertisedPrefixeRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class PatchPublicAdvertisedPrefixeRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeletePublicDelegatedPrefixeRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertPublicDelegatedPrefixeRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class PatchPublicDelegatedPrefixeRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteRegionAutoscalerRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertRegionAutoscalerRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class PatchRegionAutoscalerRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class UpdateRegionAutoscalerRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteRegionBackendServiceRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertRegionBackendServiceRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class PatchRegionBackendServiceRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class UpdateRegionBackendServiceRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertRegionCommitmentRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class AddResourcePoliciesRegionDiskRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class CreateSnapshotRegionDiskRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteRegionDiskRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertRegionDiskRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class RemoveResourcePoliciesRegionDiskRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class ResizeRegionDiskRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class SetLabelsRegionDiskRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteRegionHealthCheckServiceRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertRegionHealthCheckServiceRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class PatchRegionHealthCheckServiceRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteRegionHealthCheckRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertRegionHealthCheckRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class PatchRegionHealthCheckRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class UpdateRegionHealthCheckRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class AbandonInstancesRegionInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class CreateInstancesRegionInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteRegionInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteInstancesRegionInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertRegionInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class PatchRegionInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class RecreateInstancesRegionInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class ResizeRegionInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class SetInstanceTemplateRegionInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class SetTargetPoolsRegionInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class SetNamedPortsRegionInstanceGroupRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class BulkInsertRegionInstanceRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteRegionNetworkEndpointGroupRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertRegionNetworkEndpointGroupRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteRegionNotificationEndpointRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertRegionNotificationEndpointRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteRegionSslCertificateRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertRegionSslCertificateRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteRegionTargetHttpProxyRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertRegionTargetHttpProxyRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class SetUrlMapRegionTargetHttpProxyRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteRegionTargetHttpsProxyRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertRegionTargetHttpsProxyRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class SetSslCertificatesRegionTargetHttpsProxyRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class SetUrlMapRegionTargetHttpsProxyRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteRegionUrlMapRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertRegionUrlMapRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class PatchRegionUrlMapRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class UpdateRegionUrlMapRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteReservationRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class InsertReservationRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class ResizeReservationRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class DeleteResourcePolicyRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertResourcePolicyRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteRouterRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertRouterRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class PatchRouterRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class UpdateRouterRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteRouteRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertRouteRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class AddRuleSecurityPolicyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeleteSecurityPolicyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertSecurityPolicyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class PatchSecurityPolicyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class PatchRuleSecurityPolicyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class RemoveRuleSecurityPolicyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeleteSnapshotRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class SetLabelsSnapshotRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeleteSslCertificateRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertSslCertificateRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeleteSslPolicyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertSslPolicyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class PatchSslPolicyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeleteSubnetworkRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class ExpandIpCidrRangeSubnetworkRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertSubnetworkRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class PatchSubnetworkRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class SetPrivateIpGoogleAccessSubnetworkRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteTargetGrpcProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertTargetGrpcProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class PatchTargetGrpcProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeleteTargetHttpProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertTargetHttpProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class PatchTargetHttpProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class SetUrlMapTargetHttpProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeleteTargetHttpsProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertTargetHttpsProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class PatchTargetHttpsProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class SetQuicOverrideTargetHttpsProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class SetSslCertificatesTargetHttpsProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class SetSslPolicyTargetHttpsProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class SetUrlMapTargetHttpsProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeleteTargetInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class InsertTargetInstanceRequest + { + internal void PopulatePollRequestFields(GetZoneOperationRequest pollRequest) + { + pollRequest.Zone = Zone; + pollRequest.Project = Project; + } + } + + public partial class AddHealthCheckTargetPoolRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class AddInstanceTargetPoolRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteTargetPoolRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertTargetPoolRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class RemoveHealthCheckTargetPoolRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class RemoveInstanceTargetPoolRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class SetBackupTargetPoolRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteTargetSslProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertTargetSslProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class SetBackendServiceTargetSslProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class SetProxyHeaderTargetSslProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class SetSslCertificatesTargetSslProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class SetSslPolicyTargetSslProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeleteTargetTcpProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertTargetTcpProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class SetBackendServiceTargetTcpProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class SetProxyHeaderTargetTcpProxyRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeleteTargetVpnGatewayRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertTargetVpnGatewayRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteUrlMapRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InsertUrlMapRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class InvalidateCacheUrlMapRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class PatchUrlMapRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class UpdateUrlMapRequest + { + internal void PopulatePollRequestFields(GetGlobalOperationRequest pollRequest) => pollRequest.Project = Project; + } + + public partial class DeleteVpnGatewayRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertVpnGatewayRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class SetLabelsVpnGatewayRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class DeleteVpnTunnelRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class InsertVpnTunnelRequest + { + internal void PopulatePollRequestFields(GetRegionOperationRequest pollRequest) + { + pollRequest.Region = Region; + pollRequest.Project = Project; + } + } + + public partial class GetGlobalOperationRequest + { + private static gax::PathTemplate s_operationNameTemplate = new gax::PathTemplate("operation/{operation}/project/{project}"); + + internal static GetGlobalOperationRequest ParseLroRequest(lro::GetOperationRequest request) + { + gax::TemplatedResourceName parsedName = s_operationNameTemplate.ParseName(request.Name); + return new GetGlobalOperationRequest + { + Operation = parsedName[0], + Project = parsedName[1], + }; + } + + internal static GetGlobalOperationRequest FromInitialResponse(Operation response) => + new GetGlobalOperationRequest + { + Operation = response.Name, + }; + + internal string ToLroOperationName() => s_operationNameTemplate.Expand(Operation, Project); + } + + public partial class GetGlobalOrganizationOperationRequest + { + private static gax::PathTemplate s_operationNameTemplate = new gax::PathTemplate("operation/{operation}"); + + internal static GetGlobalOrganizationOperationRequest ParseLroRequest(lro::GetOperationRequest request) + { + gax::TemplatedResourceName parsedName = s_operationNameTemplate.ParseName(request.Name); + return new GetGlobalOrganizationOperationRequest + { + Operation = parsedName[0], + }; + } + + internal static GetGlobalOrganizationOperationRequest FromInitialResponse(Operation response) => + new GetGlobalOrganizationOperationRequest + { + Operation = response.Name, + }; + + internal string ToLroOperationName() => s_operationNameTemplate.Expand(Operation); + } + + public partial class GetRegionOperationRequest + { + private static gax::PathTemplate s_operationNameTemplate = new gax::PathTemplate("operation/{operation}/region/{region}/project/{project}"); + + internal static GetRegionOperationRequest ParseLroRequest(lro::GetOperationRequest request) + { + gax::TemplatedResourceName parsedName = s_operationNameTemplate.ParseName(request.Name); + return new GetRegionOperationRequest + { + Operation = parsedName[0], + Region = parsedName[1], + Project = parsedName[2], + }; + } + + internal static GetRegionOperationRequest FromInitialResponse(Operation response) => + new GetRegionOperationRequest + { + Operation = response.Name, + }; + + internal string ToLroOperationName() => s_operationNameTemplate.Expand(Operation, Region, Project); + } + + public partial class GetZoneOperationRequest + { + private static gax::PathTemplate s_operationNameTemplate = new gax::PathTemplate("zone/{zone}/operation/{operation}/project/{project}"); + + internal static GetZoneOperationRequest ParseLroRequest(lro::GetOperationRequest request) + { + gax::TemplatedResourceName parsedName = s_operationNameTemplate.ParseName(request.Name); + return new GetZoneOperationRequest + { + Zone = parsedName[0], + Operation = parsedName[1], + Project = parsedName[2], + }; + } + + internal static GetZoneOperationRequest FromInitialResponse(Operation response) => + new GetZoneOperationRequest + { + Operation = response.Name, + }; + + internal string ToLroOperationName() => s_operationNameTemplate.Expand(Zone, Operation, Project); + } +} diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/DisksClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/DisksClient.g.cs index 682a4dfcbb77..80bf932665e7 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/DisksClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/DisksClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,17 +46,24 @@ private DisksSettings(DisksSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AddResourcePoliciesSettings = existing.AddResourcePoliciesSettings; + AddResourcePoliciesOperationsSettings = existing.AddResourcePoliciesOperationsSettings.Clone(); AggregatedListSettings = existing.AggregatedListSettings; CreateSnapshotSettings = existing.CreateSnapshotSettings; + CreateSnapshotOperationsSettings = existing.CreateSnapshotOperationsSettings.Clone(); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; GetIamPolicySettings = existing.GetIamPolicySettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; RemoveResourcePoliciesSettings = existing.RemoveResourcePoliciesSettings; + RemoveResourcePoliciesOperationsSettings = existing.RemoveResourcePoliciesOperationsSettings.Clone(); ResizeSettings = existing.ResizeSettings; + ResizeOperationsSettings = existing.ResizeOperationsSettings.Clone(); SetIamPolicySettings = existing.SetIamPolicySettings; SetLabelsSettings = existing.SetLabelsSettings; + SetLabelsOperationsSettings = existing.SetLabelsOperationsSettings.Clone(); TestIamPermissionsSettings = existing.TestIamPermissionsSettings; OnCopy(existing); } @@ -74,6 +82,24 @@ private DisksSettings(DisksSettings existing) : base(existing) /// public gaxgrpc::CallSettings AddResourcePoliciesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to DisksClient.AddResourcePolicies and + /// DisksClient.AddResourcePoliciesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings AddResourcePoliciesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to DisksClient.AggregatedList /// and DisksClient.AggregatedListAsync. @@ -98,6 +124,24 @@ private DisksSettings(DisksSettings existing) : base(existing) /// public gaxgrpc::CallSettings CreateSnapshotSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to DisksClient.CreateSnapshot and + /// DisksClient.CreateSnapshotAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings CreateSnapshotOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to DisksClient.Delete and /// DisksClient.DeleteAsync. @@ -110,6 +154,23 @@ private DisksSettings(DisksSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to DisksClient.Delete and DisksClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to DisksClient.Get and /// DisksClient.GetAsync. @@ -146,6 +207,23 @@ private DisksSettings(DisksSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to DisksClient.Insert and DisksClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to DisksClient.List and /// DisksClient.ListAsync. @@ -170,6 +248,24 @@ private DisksSettings(DisksSettings existing) : base(existing) /// public gaxgrpc::CallSettings RemoveResourcePoliciesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to DisksClient.RemoveResourcePolicies and + /// DisksClient.RemoveResourcePoliciesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings RemoveResourcePoliciesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to DisksClient.Resize and /// DisksClient.ResizeAsync. @@ -182,6 +278,23 @@ private DisksSettings(DisksSettings existing) : base(existing) /// public gaxgrpc::CallSettings ResizeSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to DisksClient.Resize and DisksClient.ResizeAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings ResizeOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to DisksClient.SetIamPolicy /// and DisksClient.SetIamPolicyAsync. @@ -206,6 +319,24 @@ private DisksSettings(DisksSettings existing) : base(existing) /// public gaxgrpc::CallSettings SetLabelsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to DisksClient.SetLabels and DisksClient.SetLabelsAsync + /// . + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetLabelsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// DisksClient.TestIamPermissions and DisksClient.TestIamPermissionsAsync. @@ -385,7 +516,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddResourcePolicies(AddResourcePoliciesDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddResourcePolicies(AddResourcePoliciesDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -394,7 +525,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddResourcePoliciesAsync(AddResourcePoliciesDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddResourcePoliciesAsync(AddResourcePoliciesDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -403,9 +534,36 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddResourcePoliciesAsync(AddResourcePoliciesDiskRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddResourcePoliciesAsync(AddResourcePoliciesDiskRequest request, st::CancellationToken cancellationToken) => AddResourcePoliciesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for AddResourcePolicies. + public virtual lro::OperationsClient AddResourcePoliciesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of AddResourcePolicies + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceAddResourcePolicies(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddResourcePoliciesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// AddResourcePolicies. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceAddResourcePoliciesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddResourcePoliciesOperationsClient, callSettings); + /// /// Adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation. /// @@ -423,7 +581,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddResourcePolicies(string project, string zone, string disk, DisksAddResourcePoliciesRequest disksAddResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddResourcePolicies(string project, string zone, string disk, DisksAddResourcePoliciesRequest disksAddResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => AddResourcePolicies(new AddResourcePoliciesDiskRequest { Disk = gax::GaxPreconditions.CheckNotNullOrEmpty(disk, nameof(disk)), @@ -449,7 +607,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddResourcePoliciesAsync(string project, string zone, string disk, DisksAddResourcePoliciesRequest disksAddResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddResourcePoliciesAsync(string project, string zone, string disk, DisksAddResourcePoliciesRequest disksAddResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => AddResourcePoliciesAsync(new AddResourcePoliciesDiskRequest { Disk = gax::GaxPreconditions.CheckNotNullOrEmpty(disk, nameof(disk)), @@ -475,7 +633,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddResourcePoliciesAsync(string project, string zone, string disk, DisksAddResourcePoliciesRequest disksAddResourcePoliciesRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddResourcePoliciesAsync(string project, string zone, string disk, DisksAddResourcePoliciesRequest disksAddResourcePoliciesRequestResource, st::CancellationToken cancellationToken) => AddResourcePoliciesAsync(project, zone, disk, disksAddResourcePoliciesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -554,7 +712,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation CreateSnapshot(CreateSnapshotDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation CreateSnapshot(CreateSnapshotDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -563,7 +721,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task CreateSnapshotAsync(CreateSnapshotDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> CreateSnapshotAsync(CreateSnapshotDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -572,9 +730,35 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task CreateSnapshotAsync(CreateSnapshotDiskRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> CreateSnapshotAsync(CreateSnapshotDiskRequest request, st::CancellationToken cancellationToken) => CreateSnapshotAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for CreateSnapshot. + public virtual lro::OperationsClient CreateSnapshotOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of CreateSnapshot. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceCreateSnapshot(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), CreateSnapshotOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// CreateSnapshot. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceCreateSnapshotAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), CreateSnapshotOperationsClient, callSettings); + /// /// Creates a snapshot of a specified persistent disk. /// @@ -592,7 +776,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation CreateSnapshot(string project, string zone, string disk, Snapshot snapshotResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation CreateSnapshot(string project, string zone, string disk, Snapshot snapshotResource, gaxgrpc::CallSettings callSettings = null) => CreateSnapshot(new CreateSnapshotDiskRequest { Disk = gax::GaxPreconditions.CheckNotNullOrEmpty(disk, nameof(disk)), @@ -618,7 +802,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task CreateSnapshotAsync(string project, string zone, string disk, Snapshot snapshotResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> CreateSnapshotAsync(string project, string zone, string disk, Snapshot snapshotResource, gaxgrpc::CallSettings callSettings = null) => CreateSnapshotAsync(new CreateSnapshotDiskRequest { Disk = gax::GaxPreconditions.CheckNotNullOrEmpty(disk, nameof(disk)), @@ -644,7 +828,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task CreateSnapshotAsync(string project, string zone, string disk, Snapshot snapshotResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> CreateSnapshotAsync(string project, string zone, string disk, Snapshot snapshotResource, st::CancellationToken cancellationToken) => CreateSnapshotAsync(project, zone, disk, snapshotResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -653,7 +837,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -662,7 +846,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -671,9 +855,35 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteDiskRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteDiskRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. /// @@ -688,7 +898,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string zone, string disk, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string zone, string disk, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteDiskRequest { Disk = gax::GaxPreconditions.CheckNotNullOrEmpty(disk, nameof(disk)), @@ -710,7 +920,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string zone, string disk, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string zone, string disk, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteDiskRequest { Disk = gax::GaxPreconditions.CheckNotNullOrEmpty(disk, nameof(disk)), @@ -732,7 +942,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string zone, string disk, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string zone, string disk, st::CancellationToken cancellationToken) => DeleteAsync(project, zone, disk, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -917,7 +1127,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -926,7 +1136,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -935,9 +1145,35 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertDiskRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertDiskRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a persistent disk in the specified project using the data in the request. You can create a disk from a source (sourceImage, sourceSnapshot, or sourceDisk) or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property. /// @@ -952,7 +1188,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string zone, Disk diskResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string zone, Disk diskResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertDiskRequest { DiskResource = gax::GaxPreconditions.CheckNotNull(diskResource, nameof(diskResource)), @@ -974,7 +1210,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string zone, Disk diskResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string zone, Disk diskResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertDiskRequest { DiskResource = gax::GaxPreconditions.CheckNotNull(diskResource, nameof(diskResource)), @@ -996,7 +1232,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string zone, Disk diskResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string zone, Disk diskResource, st::CancellationToken cancellationToken) => InsertAsync(project, zone, diskResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1079,7 +1315,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RemoveResourcePolicies(RemoveResourcePoliciesDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RemoveResourcePolicies(RemoveResourcePoliciesDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1088,7 +1324,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RemoveResourcePoliciesAsync(RemoveResourcePoliciesDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RemoveResourcePoliciesAsync(RemoveResourcePoliciesDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1097,9 +1333,36 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RemoveResourcePoliciesAsync(RemoveResourcePoliciesDiskRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> RemoveResourcePoliciesAsync(RemoveResourcePoliciesDiskRequest request, st::CancellationToken cancellationToken) => RemoveResourcePoliciesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for RemoveResourcePolicies. + public virtual lro::OperationsClient RemoveResourcePoliciesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of + /// RemoveResourcePolicies. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceRemoveResourcePolicies(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RemoveResourcePoliciesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// RemoveResourcePolicies. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceRemoveResourcePoliciesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RemoveResourcePoliciesOperationsClient, callSettings); + /// /// Removes resource policies from a disk. /// @@ -1117,7 +1380,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RemoveResourcePolicies(string project, string zone, string disk, DisksRemoveResourcePoliciesRequest disksRemoveResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RemoveResourcePolicies(string project, string zone, string disk, DisksRemoveResourcePoliciesRequest disksRemoveResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => RemoveResourcePolicies(new RemoveResourcePoliciesDiskRequest { Disk = gax::GaxPreconditions.CheckNotNullOrEmpty(disk, nameof(disk)), @@ -1143,7 +1406,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RemoveResourcePoliciesAsync(string project, string zone, string disk, DisksRemoveResourcePoliciesRequest disksRemoveResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RemoveResourcePoliciesAsync(string project, string zone, string disk, DisksRemoveResourcePoliciesRequest disksRemoveResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => RemoveResourcePoliciesAsync(new RemoveResourcePoliciesDiskRequest { Disk = gax::GaxPreconditions.CheckNotNullOrEmpty(disk, nameof(disk)), @@ -1169,7 +1432,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RemoveResourcePoliciesAsync(string project, string zone, string disk, DisksRemoveResourcePoliciesRequest disksRemoveResourcePoliciesRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> RemoveResourcePoliciesAsync(string project, string zone, string disk, DisksRemoveResourcePoliciesRequest disksRemoveResourcePoliciesRequestResource, st::CancellationToken cancellationToken) => RemoveResourcePoliciesAsync(project, zone, disk, disksRemoveResourcePoliciesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1178,7 +1441,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Resize(ResizeDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Resize(ResizeDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1187,7 +1450,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task ResizeAsync(ResizeDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> ResizeAsync(ResizeDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1196,9 +1459,35 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task ResizeAsync(ResizeDiskRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> ResizeAsync(ResizeDiskRequest request, st::CancellationToken cancellationToken) => ResizeAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Resize. + public virtual lro::OperationsClient ResizeOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Resize. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceResize(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), ResizeOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Resize + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceResizeAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), ResizeOperationsClient, callSettings); + /// /// Resizes the specified persistent disk. You can only increase the size of the disk. /// @@ -1216,7 +1505,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Resize(string project, string zone, string disk, DisksResizeRequest disksResizeRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Resize(string project, string zone, string disk, DisksResizeRequest disksResizeRequestResource, gaxgrpc::CallSettings callSettings = null) => Resize(new ResizeDiskRequest { Disk = gax::GaxPreconditions.CheckNotNullOrEmpty(disk, nameof(disk)), @@ -1242,7 +1531,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task ResizeAsync(string project, string zone, string disk, DisksResizeRequest disksResizeRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> ResizeAsync(string project, string zone, string disk, DisksResizeRequest disksResizeRequestResource, gaxgrpc::CallSettings callSettings = null) => ResizeAsync(new ResizeDiskRequest { Disk = gax::GaxPreconditions.CheckNotNullOrEmpty(disk, nameof(disk)), @@ -1268,7 +1557,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task ResizeAsync(string project, string zone, string disk, DisksResizeRequest disksResizeRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> ResizeAsync(string project, string zone, string disk, DisksResizeRequest disksResizeRequestResource, st::CancellationToken cancellationToken) => ResizeAsync(project, zone, disk, disksResizeRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1376,7 +1665,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetLabels(SetLabelsDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetLabels(SetLabelsDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1385,7 +1674,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(SetLabelsDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetLabelsAsync(SetLabelsDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1394,9 +1683,35 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(SetLabelsDiskRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetLabelsAsync(SetLabelsDiskRequest request, st::CancellationToken cancellationToken) => SetLabelsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetLabels. + public virtual lro::OperationsClient SetLabelsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetLabels. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetLabels(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetLabelsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetLabels. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetLabelsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetLabelsOperationsClient, callSettings); + /// /// Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. /// @@ -1414,7 +1729,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetLabels(string project, string zone, string resource, ZoneSetLabelsRequest zoneSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetLabels(string project, string zone, string resource, ZoneSetLabelsRequest zoneSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetLabels(new SetLabelsDiskRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1440,7 +1755,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(string project, string zone, string resource, ZoneSetLabelsRequest zoneSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetLabelsAsync(string project, string zone, string resource, ZoneSetLabelsRequest zoneSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetLabelsAsync(new SetLabelsDiskRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1466,7 +1781,7 @@ internal static DisksClient Create(grpccore::CallInvoker callInvoker, DisksSetti /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(string project, string zone, string resource, ZoneSetLabelsRequest zoneSetLabelsRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetLabelsAsync(string project, string zone, string resource, ZoneSetLabelsRequest zoneSetLabelsRequestResource, st::CancellationToken cancellationToken) => SetLabelsAsync(project, zone, resource, zoneSetLabelsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1611,6 +1926,13 @@ public DisksClientImpl(Disks.DisksClient grpcClient, DisksSettings settings) GrpcClient = grpcClient; DisksSettings effectiveSettings = settings ?? DisksSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + AddResourcePoliciesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.AddResourcePoliciesOperationsSettings); + CreateSnapshotOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.CreateSnapshotOperationsSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.InsertOperationsSettings); + RemoveResourcePoliciesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.RemoveResourcePoliciesOperationsSettings); + ResizeOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.ResizeOperationsSettings); + SetLabelsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.SetLabelsOperationsSettings); _callAddResourcePolicies = clientHelper.BuildApiCall(grpcClient.AddResourcePoliciesAsync, grpcClient.AddResourcePolicies, effectiveSettings.AddResourcePoliciesSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("zone", request => request.Zone).WithGoogleRequestParam("disk", request => request.Disk); Modify_ApiCall(ref _callAddResourcePolicies); Modify_AddResourcePoliciesApiCall(ref _callAddResourcePolicies); @@ -1712,16 +2034,22 @@ public DisksClientImpl(Disks.DisksClient grpcClient, DisksSettings settings) partial void Modify_TestIamPermissionsDiskRequest(ref TestIamPermissionsDiskRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for AddResourcePolicies. + public override lro::OperationsClient AddResourcePoliciesOperationsClient { get; } + /// /// Adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation AddResourcePolicies(AddResourcePoliciesDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation AddResourcePolicies(AddResourcePoliciesDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddResourcePoliciesDiskRequest(ref request, ref callSettings); - return _callAddResourcePolicies.Sync(request, callSettings); + Operation response = _callAddResourcePolicies.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddResourcePoliciesOperationsClient); } /// @@ -1730,10 +2058,13 @@ public override Operation AddResourcePolicies(AddResourcePoliciesDiskRequest req /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task AddResourcePoliciesAsync(AddResourcePoliciesDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> AddResourcePoliciesAsync(AddResourcePoliciesDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddResourcePoliciesDiskRequest(ref request, ref callSettings); - return _callAddResourcePolicies.Async(request, callSettings); + Operation response = await _callAddResourcePolicies.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddResourcePoliciesOperationsClient); } /// @@ -1762,16 +2093,22 @@ public override Operation AddResourcePolicies(AddResourcePoliciesDiskRequest req return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for CreateSnapshot. + public override lro::OperationsClient CreateSnapshotOperationsClient { get; } + /// /// Creates a snapshot of a specified persistent disk. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation CreateSnapshot(CreateSnapshotDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation CreateSnapshot(CreateSnapshotDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_CreateSnapshotDiskRequest(ref request, ref callSettings); - return _callCreateSnapshot.Sync(request, callSettings); + Operation response = _callCreateSnapshot.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), CreateSnapshotOperationsClient); } /// @@ -1780,22 +2117,31 @@ public override Operation CreateSnapshot(CreateSnapshotDiskRequest request, gaxg /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task CreateSnapshotAsync(CreateSnapshotDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> CreateSnapshotAsync(CreateSnapshotDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_CreateSnapshotDiskRequest(ref request, ref callSettings); - return _callCreateSnapshot.Async(request, callSettings); + Operation response = await _callCreateSnapshot.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), CreateSnapshotOperationsClient); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteDiskRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1804,10 +2150,13 @@ public override Operation Delete(DeleteDiskRequest request, gaxgrpc::CallSetting /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteDiskRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1858,16 +2207,22 @@ public override Policy GetIamPolicy(GetIamPolicyDiskRequest request, gaxgrpc::Ca return _callGetIamPolicy.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a persistent disk in the specified project using the data in the request. You can create a disk from a source (sourceImage, sourceSnapshot, or sourceDisk) or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertDiskRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1876,10 +2231,13 @@ public override Operation Insert(InsertDiskRequest request, gaxgrpc::CallSetting /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertDiskRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1906,16 +2264,22 @@ public override Operation Insert(InsertDiskRequest request, gaxgrpc::CallSetting return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for RemoveResourcePolicies. + public override lro::OperationsClient RemoveResourcePoliciesOperationsClient { get; } + /// /// Removes resource policies from a disk. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation RemoveResourcePolicies(RemoveResourcePoliciesDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation RemoveResourcePolicies(RemoveResourcePoliciesDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RemoveResourcePoliciesDiskRequest(ref request, ref callSettings); - return _callRemoveResourcePolicies.Sync(request, callSettings); + Operation response = _callRemoveResourcePolicies.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RemoveResourcePoliciesOperationsClient); } /// @@ -1924,22 +2288,31 @@ public override Operation RemoveResourcePolicies(RemoveResourcePoliciesDiskReque /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task RemoveResourcePoliciesAsync(RemoveResourcePoliciesDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> RemoveResourcePoliciesAsync(RemoveResourcePoliciesDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RemoveResourcePoliciesDiskRequest(ref request, ref callSettings); - return _callRemoveResourcePolicies.Async(request, callSettings); + Operation response = await _callRemoveResourcePolicies.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RemoveResourcePoliciesOperationsClient); } + /// The long-running operations client for Resize. + public override lro::OperationsClient ResizeOperationsClient { get; } + /// /// Resizes the specified persistent disk. You can only increase the size of the disk. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Resize(ResizeDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Resize(ResizeDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ResizeDiskRequest(ref request, ref callSettings); - return _callResize.Sync(request, callSettings); + Operation response = _callResize.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), ResizeOperationsClient); } /// @@ -1948,10 +2321,13 @@ public override Operation Resize(ResizeDiskRequest request, gaxgrpc::CallSetting /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task ResizeAsync(ResizeDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> ResizeAsync(ResizeDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ResizeDiskRequest(ref request, ref callSettings); - return _callResize.Async(request, callSettings); + Operation response = await _callResize.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), ResizeOperationsClient); } /// @@ -1978,16 +2354,22 @@ public override Policy SetIamPolicy(SetIamPolicyDiskRequest request, gaxgrpc::Ca return _callSetIamPolicy.Async(request, callSettings); } + /// The long-running operations client for SetLabels. + public override lro::OperationsClient SetLabelsOperationsClient { get; } + /// /// Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetLabels(SetLabelsDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetLabels(SetLabelsDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetLabelsDiskRequest(ref request, ref callSettings); - return _callSetLabels.Sync(request, callSettings); + Operation response = _callSetLabels.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetLabelsOperationsClient); } /// @@ -1996,10 +2378,13 @@ public override Operation SetLabels(SetLabelsDiskRequest request, gaxgrpc::CallS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetLabelsAsync(SetLabelsDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetLabelsAsync(SetLabelsDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetLabelsDiskRequest(ref request, ref callSettings); - return _callSetLabels.Async(request, callSettings); + Operation response = await _callSetLabels.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetLabelsOperationsClient); } /// @@ -2062,4 +2447,18 @@ public partial class DiskList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class Disks + { + public partial class DisksClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to ZoneOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForZoneOperations() => + ZoneOperations.ZoneOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ExternalVpnGatewaysClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ExternalVpnGatewaysClient.g.cs index 53147f4e6660..82c14c79c878 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ExternalVpnGatewaysClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ExternalVpnGatewaysClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,10 +46,13 @@ private ExternalVpnGatewaysSettings(ExternalVpnGatewaysSettings existing) : base { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; SetLabelsSettings = existing.SetLabelsSettings; + SetLabelsOperationsSettings = existing.SetLabelsOperationsSettings.Clone(); TestIamPermissionsSettings = existing.TestIamPermissionsSettings; OnCopy(existing); } @@ -67,6 +71,24 @@ private ExternalVpnGatewaysSettings(ExternalVpnGatewaysSettings existing) : base /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ExternalVpnGatewaysClient.Delete and + /// ExternalVpnGatewaysClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// ExternalVpnGatewaysClient.Get and ExternalVpnGatewaysClient.GetAsync. @@ -91,6 +113,24 @@ private ExternalVpnGatewaysSettings(ExternalVpnGatewaysSettings existing) : base /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ExternalVpnGatewaysClient.Insert and + /// ExternalVpnGatewaysClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// ExternalVpnGatewaysClient.List and ExternalVpnGatewaysClient.ListAsync. @@ -115,6 +155,24 @@ private ExternalVpnGatewaysSettings(ExternalVpnGatewaysSettings existing) : base /// public gaxgrpc::CallSettings SetLabelsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ExternalVpnGatewaysClient.SetLabels and + /// ExternalVpnGatewaysClient.SetLabelsAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetLabelsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// ExternalVpnGatewaysClient.TestIamPermissions and ExternalVpnGatewaysClient.TestIamPermissionsAsync @@ -300,7 +358,7 @@ internal static ExternalVpnGatewaysClient Create(grpccore::CallInvoker callInvok /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -309,7 +367,7 @@ internal static ExternalVpnGatewaysClient Create(grpccore::CallInvoker callInvok /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -318,9 +376,35 @@ internal static ExternalVpnGatewaysClient Create(grpccore::CallInvoker callInvok /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteExternalVpnGatewayRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteExternalVpnGatewayRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified externalVpnGateway. /// @@ -332,7 +416,7 @@ internal static ExternalVpnGatewaysClient Create(grpccore::CallInvoker callInvok /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string externalVpnGateway, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string externalVpnGateway, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteExternalVpnGatewayRequest { ExternalVpnGateway = gax::GaxPreconditions.CheckNotNullOrEmpty(externalVpnGateway, nameof(externalVpnGateway)), @@ -350,7 +434,7 @@ internal static ExternalVpnGatewaysClient Create(grpccore::CallInvoker callInvok /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string externalVpnGateway, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string externalVpnGateway, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteExternalVpnGatewayRequest { ExternalVpnGateway = gax::GaxPreconditions.CheckNotNullOrEmpty(externalVpnGateway, nameof(externalVpnGateway)), @@ -368,7 +452,7 @@ internal static ExternalVpnGatewaysClient Create(grpccore::CallInvoker callInvok /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string externalVpnGateway, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string externalVpnGateway, st::CancellationToken cancellationToken) => DeleteAsync(project, externalVpnGateway, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -454,7 +538,7 @@ internal static ExternalVpnGatewaysClient Create(grpccore::CallInvoker callInvok /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -463,7 +547,7 @@ internal static ExternalVpnGatewaysClient Create(grpccore::CallInvoker callInvok /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -472,9 +556,35 @@ internal static ExternalVpnGatewaysClient Create(grpccore::CallInvoker callInvok /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertExternalVpnGatewayRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertExternalVpnGatewayRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a ExternalVpnGateway in the specified project using the data included in the request. /// @@ -486,7 +596,7 @@ internal static ExternalVpnGatewaysClient Create(grpccore::CallInvoker callInvok /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, ExternalVpnGateway externalVpnGatewayResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, ExternalVpnGateway externalVpnGatewayResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertExternalVpnGatewayRequest { ExternalVpnGatewayResource = gax::GaxPreconditions.CheckNotNull(externalVpnGatewayResource, nameof(externalVpnGatewayResource)), @@ -504,7 +614,7 @@ internal static ExternalVpnGatewaysClient Create(grpccore::CallInvoker callInvok /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, ExternalVpnGateway externalVpnGatewayResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, ExternalVpnGateway externalVpnGatewayResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertExternalVpnGatewayRequest { ExternalVpnGatewayResource = gax::GaxPreconditions.CheckNotNull(externalVpnGatewayResource, nameof(externalVpnGatewayResource)), @@ -522,7 +632,7 @@ internal static ExternalVpnGatewaysClient Create(grpccore::CallInvoker callInvok /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, ExternalVpnGateway externalVpnGatewayResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, ExternalVpnGateway externalVpnGatewayResource, st::CancellationToken cancellationToken) => InsertAsync(project, externalVpnGatewayResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -597,7 +707,7 @@ internal static ExternalVpnGatewaysClient Create(grpccore::CallInvoker callInvok /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetLabels(SetLabelsExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetLabels(SetLabelsExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -606,7 +716,7 @@ internal static ExternalVpnGatewaysClient Create(grpccore::CallInvoker callInvok /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(SetLabelsExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetLabelsAsync(SetLabelsExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -615,9 +725,35 @@ internal static ExternalVpnGatewaysClient Create(grpccore::CallInvoker callInvok /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(SetLabelsExternalVpnGatewayRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetLabelsAsync(SetLabelsExternalVpnGatewayRequest request, st::CancellationToken cancellationToken) => SetLabelsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetLabels. + public virtual lro::OperationsClient SetLabelsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetLabels. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetLabels(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetLabelsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetLabels. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetLabelsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetLabelsOperationsClient, callSettings); + /// /// Sets the labels on an ExternalVpnGateway. To learn more about labels, read the Labeling Resources documentation. /// @@ -632,7 +768,7 @@ internal static ExternalVpnGatewaysClient Create(grpccore::CallInvoker callInvok /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetLabels(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetLabels(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetLabels(new SetLabelsExternalVpnGatewayRequest { GlobalSetLabelsRequestResource = gax::GaxPreconditions.CheckNotNull(globalSetLabelsRequestResource, nameof(globalSetLabelsRequestResource)), @@ -654,7 +790,7 @@ internal static ExternalVpnGatewaysClient Create(grpccore::CallInvoker callInvok /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetLabelsAsync(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetLabelsAsync(new SetLabelsExternalVpnGatewayRequest { GlobalSetLabelsRequestResource = gax::GaxPreconditions.CheckNotNull(globalSetLabelsRequestResource, nameof(globalSetLabelsRequestResource)), @@ -676,7 +812,7 @@ internal static ExternalVpnGatewaysClient Create(grpccore::CallInvoker callInvok /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetLabelsAsync(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, st::CancellationToken cancellationToken) => SetLabelsAsync(project, resource, globalSetLabelsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -797,6 +933,9 @@ public ExternalVpnGatewaysClientImpl(ExternalVpnGateways.ExternalVpnGatewaysClie GrpcClient = grpcClient; ExternalVpnGatewaysSettings effectiveSettings = settings ?? ExternalVpnGatewaysSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); + SetLabelsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.SetLabelsOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("external_vpn_gateway", request => request.ExternalVpnGateway); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -849,16 +988,22 @@ public ExternalVpnGatewaysClientImpl(ExternalVpnGateways.ExternalVpnGatewaysClie partial void Modify_TestIamPermissionsExternalVpnGatewayRequest(ref TestIamPermissionsExternalVpnGatewayRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified externalVpnGateway. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteExternalVpnGatewayRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -867,10 +1012,13 @@ public override Operation Delete(DeleteExternalVpnGatewayRequest request, gaxgrp /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteExternalVpnGatewayRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -897,16 +1045,22 @@ public override ExternalVpnGateway Get(GetExternalVpnGatewayRequest request, gax return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a ExternalVpnGateway in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertExternalVpnGatewayRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -915,10 +1069,13 @@ public override Operation Insert(InsertExternalVpnGatewayRequest request, gaxgrp /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertExternalVpnGatewayRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -945,16 +1102,22 @@ public override Operation Insert(InsertExternalVpnGatewayRequest request, gaxgrp return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for SetLabels. + public override lro::OperationsClient SetLabelsOperationsClient { get; } + /// /// Sets the labels on an ExternalVpnGateway. To learn more about labels, read the Labeling Resources documentation. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetLabels(SetLabelsExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetLabels(SetLabelsExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetLabelsExternalVpnGatewayRequest(ref request, ref callSettings); - return _callSetLabels.Sync(request, callSettings); + Operation response = _callSetLabels.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetLabelsOperationsClient); } /// @@ -963,10 +1126,13 @@ public override Operation SetLabels(SetLabelsExternalVpnGatewayRequest request, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetLabelsAsync(SetLabelsExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetLabelsAsync(SetLabelsExternalVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetLabelsExternalVpnGatewayRequest(ref request, ref callSettings); - return _callSetLabels.Async(request, callSettings); + Operation response = await _callSetLabels.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetLabelsOperationsClient); } /// @@ -1011,4 +1177,18 @@ public partial class ExternalVpnGatewayList : gaxgrpc::IPageResponse GetEnumerator(); } + + public static partial class ExternalVpnGateways + { + public partial class ExternalVpnGatewaysClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/FirewallPoliciesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/FirewallPoliciesClient.g.cs index 8bef720d53d0..8c7f9bc33711 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/FirewallPoliciesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/FirewallPoliciesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,21 +46,31 @@ private FirewallPoliciesSettings(FirewallPoliciesSettings existing) : base(exist { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AddAssociationSettings = existing.AddAssociationSettings; + AddAssociationOperationsSettings = existing.AddAssociationOperationsSettings.Clone(); AddRuleSettings = existing.AddRuleSettings; + AddRuleOperationsSettings = existing.AddRuleOperationsSettings.Clone(); CloneRulesSettings = existing.CloneRulesSettings; + CloneRulesOperationsSettings = existing.CloneRulesOperationsSettings.Clone(); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; GetAssociationSettings = existing.GetAssociationSettings; GetIamPolicySettings = existing.GetIamPolicySettings; GetRuleSettings = existing.GetRuleSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; ListAssociationsSettings = existing.ListAssociationsSettings; MoveSettings = existing.MoveSettings; + MoveOperationsSettings = existing.MoveOperationsSettings.Clone(); PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); PatchRuleSettings = existing.PatchRuleSettings; + PatchRuleOperationsSettings = existing.PatchRuleOperationsSettings.Clone(); RemoveAssociationSettings = existing.RemoveAssociationSettings; + RemoveAssociationOperationsSettings = existing.RemoveAssociationOperationsSettings.Clone(); RemoveRuleSettings = existing.RemoveRuleSettings; + RemoveRuleOperationsSettings = existing.RemoveRuleOperationsSettings.Clone(); SetIamPolicySettings = existing.SetIamPolicySettings; TestIamPermissionsSettings = existing.TestIamPermissionsSettings; OnCopy(existing); @@ -79,6 +90,24 @@ private FirewallPoliciesSettings(FirewallPoliciesSettings existing) : base(exist /// public gaxgrpc::CallSettings AddAssociationSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to FirewallPoliciesClient.AddAssociation and + /// FirewallPoliciesClient.AddAssociationAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings AddAssociationOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// FirewallPoliciesClient.AddRule and FirewallPoliciesClient.AddRuleAsync. @@ -91,6 +120,24 @@ private FirewallPoliciesSettings(FirewallPoliciesSettings existing) : base(exist /// public gaxgrpc::CallSettings AddRuleSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to FirewallPoliciesClient.AddRule and + /// FirewallPoliciesClient.AddRuleAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings AddRuleOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// FirewallPoliciesClient.CloneRules and FirewallPoliciesClient.CloneRulesAsync. @@ -103,6 +150,24 @@ private FirewallPoliciesSettings(FirewallPoliciesSettings existing) : base(exist /// public gaxgrpc::CallSettings CloneRulesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to FirewallPoliciesClient.CloneRules and + /// FirewallPoliciesClient.CloneRulesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings CloneRulesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// FirewallPoliciesClient.Delete and FirewallPoliciesClient.DeleteAsync. @@ -115,6 +180,24 @@ private FirewallPoliciesSettings(FirewallPoliciesSettings existing) : base(exist /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to FirewallPoliciesClient.Delete and + /// FirewallPoliciesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to FirewallPoliciesClient.Get /// and FirewallPoliciesClient.GetAsync. @@ -175,6 +258,24 @@ private FirewallPoliciesSettings(FirewallPoliciesSettings existing) : base(exist /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to FirewallPoliciesClient.Insert and + /// FirewallPoliciesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to FirewallPoliciesClient.List /// and FirewallPoliciesClient.ListAsync. @@ -211,6 +312,24 @@ private FirewallPoliciesSettings(FirewallPoliciesSettings existing) : base(exist /// public gaxgrpc::CallSettings MoveSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to FirewallPoliciesClient.Move and + /// FirewallPoliciesClient.MoveAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings MoveOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// FirewallPoliciesClient.Patch and FirewallPoliciesClient.PatchAsync. @@ -223,6 +342,24 @@ private FirewallPoliciesSettings(FirewallPoliciesSettings existing) : base(exist /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to FirewallPoliciesClient.Patch and + /// FirewallPoliciesClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// FirewallPoliciesClient.PatchRule and FirewallPoliciesClient.PatchRuleAsync. @@ -235,6 +372,24 @@ private FirewallPoliciesSettings(FirewallPoliciesSettings existing) : base(exist /// public gaxgrpc::CallSettings PatchRuleSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to FirewallPoliciesClient.PatchRule and + /// FirewallPoliciesClient.PatchRuleAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchRuleOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// FirewallPoliciesClient.RemoveAssociation and FirewallPoliciesClient.RemoveAssociationAsync. @@ -247,6 +402,24 @@ private FirewallPoliciesSettings(FirewallPoliciesSettings existing) : base(exist /// public gaxgrpc::CallSettings RemoveAssociationSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to FirewallPoliciesClient.RemoveAssociation and + /// FirewallPoliciesClient.RemoveAssociationAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings RemoveAssociationOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// FirewallPoliciesClient.RemoveRule and FirewallPoliciesClient.RemoveRuleAsync. @@ -259,6 +432,24 @@ private FirewallPoliciesSettings(FirewallPoliciesSettings existing) : base(exist /// public gaxgrpc::CallSettings RemoveRuleSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to FirewallPoliciesClient.RemoveRule and + /// FirewallPoliciesClient.RemoveRuleAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings RemoveRuleOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// FirewallPoliciesClient.SetIamPolicy and FirewallPoliciesClient.SetIamPolicyAsync. @@ -452,7 +643,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddAssociation(AddAssociationFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddAssociation(AddAssociationFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -461,7 +652,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddAssociationAsync(AddAssociationFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddAssociationAsync(AddAssociationFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -470,9 +661,35 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddAssociationAsync(AddAssociationFirewallPolicyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddAssociationAsync(AddAssociationFirewallPolicyRequest request, st::CancellationToken cancellationToken) => AddAssociationAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for AddAssociation. + public virtual lro::OperationsClient AddAssociationOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of AddAssociation. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceAddAssociation(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddAssociationOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// AddAssociation. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceAddAssociationAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddAssociationOperationsClient, callSettings); + /// /// Inserts an association for the specified firewall policy. /// @@ -484,7 +701,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddAssociation(string firewallPolicy, FirewallPolicyAssociation firewallPolicyAssociationResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddAssociation(string firewallPolicy, FirewallPolicyAssociation firewallPolicyAssociationResource, gaxgrpc::CallSettings callSettings = null) => AddAssociation(new AddAssociationFirewallPolicyRequest { FirewallPolicy = gax::GaxPreconditions.CheckNotNullOrEmpty(firewallPolicy, nameof(firewallPolicy)), @@ -502,7 +719,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddAssociationAsync(string firewallPolicy, FirewallPolicyAssociation firewallPolicyAssociationResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddAssociationAsync(string firewallPolicy, FirewallPolicyAssociation firewallPolicyAssociationResource, gaxgrpc::CallSettings callSettings = null) => AddAssociationAsync(new AddAssociationFirewallPolicyRequest { FirewallPolicy = gax::GaxPreconditions.CheckNotNullOrEmpty(firewallPolicy, nameof(firewallPolicy)), @@ -520,7 +737,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddAssociationAsync(string firewallPolicy, FirewallPolicyAssociation firewallPolicyAssociationResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddAssociationAsync(string firewallPolicy, FirewallPolicyAssociation firewallPolicyAssociationResource, st::CancellationToken cancellationToken) => AddAssociationAsync(firewallPolicy, firewallPolicyAssociationResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -529,7 +746,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddRule(AddRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddRule(AddRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -538,7 +755,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddRuleAsync(AddRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddRuleAsync(AddRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -547,9 +764,35 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddRuleAsync(AddRuleFirewallPolicyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddRuleAsync(AddRuleFirewallPolicyRequest request, st::CancellationToken cancellationToken) => AddRuleAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for AddRule. + public virtual lro::OperationsClient AddRuleOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of AddRule. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceAddRule(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddRuleOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// AddRule. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceAddRuleAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddRuleOperationsClient, callSettings); + /// /// Inserts a rule into a firewall policy. /// @@ -561,7 +804,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddRule(string firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddRule(string firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource, gaxgrpc::CallSettings callSettings = null) => AddRule(new AddRuleFirewallPolicyRequest { FirewallPolicy = gax::GaxPreconditions.CheckNotNullOrEmpty(firewallPolicy, nameof(firewallPolicy)), @@ -579,7 +822,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddRuleAsync(string firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddRuleAsync(string firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource, gaxgrpc::CallSettings callSettings = null) => AddRuleAsync(new AddRuleFirewallPolicyRequest { FirewallPolicy = gax::GaxPreconditions.CheckNotNullOrEmpty(firewallPolicy, nameof(firewallPolicy)), @@ -597,7 +840,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddRuleAsync(string firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddRuleAsync(string firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource, st::CancellationToken cancellationToken) => AddRuleAsync(firewallPolicy, firewallPolicyRuleResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -606,7 +849,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation CloneRules(CloneRulesFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation CloneRules(CloneRulesFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -615,7 +858,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task CloneRulesAsync(CloneRulesFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> CloneRulesAsync(CloneRulesFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -624,9 +867,35 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task CloneRulesAsync(CloneRulesFirewallPolicyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> CloneRulesAsync(CloneRulesFirewallPolicyRequest request, st::CancellationToken cancellationToken) => CloneRulesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for CloneRules. + public virtual lro::OperationsClient CloneRulesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of CloneRules. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceCloneRules(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), CloneRulesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// CloneRules. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceCloneRulesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), CloneRulesOperationsClient, callSettings); + /// /// Copies rules to the specified firewall policy. /// @@ -635,7 +904,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation CloneRules(string firewallPolicy, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation CloneRules(string firewallPolicy, gaxgrpc::CallSettings callSettings = null) => CloneRules(new CloneRulesFirewallPolicyRequest { FirewallPolicy = gax::GaxPreconditions.CheckNotNullOrEmpty(firewallPolicy, nameof(firewallPolicy)), @@ -649,7 +918,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task CloneRulesAsync(string firewallPolicy, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> CloneRulesAsync(string firewallPolicy, gaxgrpc::CallSettings callSettings = null) => CloneRulesAsync(new CloneRulesFirewallPolicyRequest { FirewallPolicy = gax::GaxPreconditions.CheckNotNullOrEmpty(firewallPolicy, nameof(firewallPolicy)), @@ -663,7 +932,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task CloneRulesAsync(string firewallPolicy, st::CancellationToken cancellationToken) => + public virtual stt::Task> CloneRulesAsync(string firewallPolicy, st::CancellationToken cancellationToken) => CloneRulesAsync(firewallPolicy, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -672,7 +941,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -681,7 +950,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -690,9 +959,35 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteFirewallPolicyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteFirewallPolicyRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified policy. /// @@ -701,7 +996,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string firewallPolicy, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string firewallPolicy, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteFirewallPolicyRequest { FirewallPolicy = gax::GaxPreconditions.CheckNotNullOrEmpty(firewallPolicy, nameof(firewallPolicy)), @@ -715,7 +1010,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string firewallPolicy, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string firewallPolicy, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteFirewallPolicyRequest { FirewallPolicy = gax::GaxPreconditions.CheckNotNullOrEmpty(firewallPolicy, nameof(firewallPolicy)), @@ -729,7 +1024,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string firewallPolicy, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string firewallPolicy, st::CancellationToken cancellationToken) => DeleteAsync(firewallPolicy, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1002,7 +1297,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1011,7 +1306,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1020,9 +1315,35 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertFirewallPolicyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertFirewallPolicyRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a new policy in the specified project using the data included in the request. /// @@ -1031,7 +1352,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(FirewallPolicy firewallPolicyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(FirewallPolicy firewallPolicyResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertFirewallPolicyRequest { FirewallPolicyResource = gax::GaxPreconditions.CheckNotNull(firewallPolicyResource, nameof(firewallPolicyResource)), @@ -1045,7 +1366,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(FirewallPolicy firewallPolicyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(FirewallPolicy firewallPolicyResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertFirewallPolicyRequest { FirewallPolicyResource = gax::GaxPreconditions.CheckNotNull(firewallPolicyResource, nameof(firewallPolicyResource)), @@ -1059,7 +1380,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(FirewallPolicy firewallPolicyResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(FirewallPolicy firewallPolicyResource, st::CancellationToken cancellationToken) => InsertAsync(firewallPolicyResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1177,7 +1498,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Move(MoveFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Move(MoveFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1186,7 +1507,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task MoveAsync(MoveFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> MoveAsync(MoveFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1195,9 +1516,35 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task MoveAsync(MoveFirewallPolicyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> MoveAsync(MoveFirewallPolicyRequest request, st::CancellationToken cancellationToken) => MoveAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Move. + public virtual lro::OperationsClient MoveOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Move. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceMove(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), MoveOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Move + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceMoveAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), MoveOperationsClient, callSettings); + /// /// Moves the specified firewall policy. /// @@ -1206,7 +1553,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Move(string firewallPolicy, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Move(string firewallPolicy, gaxgrpc::CallSettings callSettings = null) => Move(new MoveFirewallPolicyRequest { FirewallPolicy = gax::GaxPreconditions.CheckNotNullOrEmpty(firewallPolicy, nameof(firewallPolicy)), @@ -1220,7 +1567,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task MoveAsync(string firewallPolicy, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> MoveAsync(string firewallPolicy, gaxgrpc::CallSettings callSettings = null) => MoveAsync(new MoveFirewallPolicyRequest { FirewallPolicy = gax::GaxPreconditions.CheckNotNullOrEmpty(firewallPolicy, nameof(firewallPolicy)), @@ -1234,7 +1581,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task MoveAsync(string firewallPolicy, st::CancellationToken cancellationToken) => + public virtual stt::Task> MoveAsync(string firewallPolicy, st::CancellationToken cancellationToken) => MoveAsync(firewallPolicy, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1243,7 +1590,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1252,7 +1599,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1261,9 +1608,35 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchFirewallPolicyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchFirewallPolicyRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Patches the specified policy with the data included in the request. /// @@ -1275,7 +1648,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string firewallPolicy, FirewallPolicy firewallPolicyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string firewallPolicy, FirewallPolicy firewallPolicyResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchFirewallPolicyRequest { FirewallPolicy = gax::GaxPreconditions.CheckNotNullOrEmpty(firewallPolicy, nameof(firewallPolicy)), @@ -1293,7 +1666,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string firewallPolicy, FirewallPolicy firewallPolicyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string firewallPolicy, FirewallPolicy firewallPolicyResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchFirewallPolicyRequest { FirewallPolicy = gax::GaxPreconditions.CheckNotNullOrEmpty(firewallPolicy, nameof(firewallPolicy)), @@ -1311,7 +1684,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string firewallPolicy, FirewallPolicy firewallPolicyResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string firewallPolicy, FirewallPolicy firewallPolicyResource, st::CancellationToken cancellationToken) => PatchAsync(firewallPolicy, firewallPolicyResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1320,7 +1693,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation PatchRule(PatchRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation PatchRule(PatchRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1329,7 +1702,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchRuleAsync(PatchRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchRuleAsync(PatchRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1338,9 +1711,35 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchRuleAsync(PatchRuleFirewallPolicyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchRuleAsync(PatchRuleFirewallPolicyRequest request, st::CancellationToken cancellationToken) => PatchRuleAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for PatchRule. + public virtual lro::OperationsClient PatchRuleOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of PatchRule. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatchRule(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchRuleOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// PatchRule. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchRuleAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchRuleOperationsClient, callSettings); + /// /// Patches a rule of the specified priority. /// @@ -1352,7 +1751,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation PatchRule(string firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation PatchRule(string firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource, gaxgrpc::CallSettings callSettings = null) => PatchRule(new PatchRuleFirewallPolicyRequest { FirewallPolicy = gax::GaxPreconditions.CheckNotNullOrEmpty(firewallPolicy, nameof(firewallPolicy)), @@ -1370,7 +1769,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchRuleAsync(string firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchRuleAsync(string firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource, gaxgrpc::CallSettings callSettings = null) => PatchRuleAsync(new PatchRuleFirewallPolicyRequest { FirewallPolicy = gax::GaxPreconditions.CheckNotNullOrEmpty(firewallPolicy, nameof(firewallPolicy)), @@ -1388,7 +1787,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchRuleAsync(string firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchRuleAsync(string firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource, st::CancellationToken cancellationToken) => PatchRuleAsync(firewallPolicy, firewallPolicyRuleResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1397,7 +1796,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RemoveAssociation(RemoveAssociationFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RemoveAssociation(RemoveAssociationFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1406,7 +1805,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RemoveAssociationAsync(RemoveAssociationFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RemoveAssociationAsync(RemoveAssociationFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1415,9 +1814,36 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RemoveAssociationAsync(RemoveAssociationFirewallPolicyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> RemoveAssociationAsync(RemoveAssociationFirewallPolicyRequest request, st::CancellationToken cancellationToken) => RemoveAssociationAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for RemoveAssociation. + public virtual lro::OperationsClient RemoveAssociationOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of RemoveAssociation + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceRemoveAssociation(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RemoveAssociationOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// RemoveAssociation. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceRemoveAssociationAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RemoveAssociationOperationsClient, callSettings); + /// /// Removes an association for the specified firewall policy. /// @@ -1426,7 +1852,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RemoveAssociation(string firewallPolicy, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RemoveAssociation(string firewallPolicy, gaxgrpc::CallSettings callSettings = null) => RemoveAssociation(new RemoveAssociationFirewallPolicyRequest { FirewallPolicy = gax::GaxPreconditions.CheckNotNullOrEmpty(firewallPolicy, nameof(firewallPolicy)), @@ -1440,7 +1866,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RemoveAssociationAsync(string firewallPolicy, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RemoveAssociationAsync(string firewallPolicy, gaxgrpc::CallSettings callSettings = null) => RemoveAssociationAsync(new RemoveAssociationFirewallPolicyRequest { FirewallPolicy = gax::GaxPreconditions.CheckNotNullOrEmpty(firewallPolicy, nameof(firewallPolicy)), @@ -1454,7 +1880,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RemoveAssociationAsync(string firewallPolicy, st::CancellationToken cancellationToken) => + public virtual stt::Task> RemoveAssociationAsync(string firewallPolicy, st::CancellationToken cancellationToken) => RemoveAssociationAsync(firewallPolicy, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1463,7 +1889,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RemoveRule(RemoveRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RemoveRule(RemoveRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1472,7 +1898,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RemoveRuleAsync(RemoveRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RemoveRuleAsync(RemoveRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1481,9 +1907,35 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RemoveRuleAsync(RemoveRuleFirewallPolicyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> RemoveRuleAsync(RemoveRuleFirewallPolicyRequest request, st::CancellationToken cancellationToken) => RemoveRuleAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for RemoveRule. + public virtual lro::OperationsClient RemoveRuleOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of RemoveRule. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceRemoveRule(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RemoveRuleOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// RemoveRule. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceRemoveRuleAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RemoveRuleOperationsClient, callSettings); + /// /// Deletes a rule of the specified priority. /// @@ -1492,7 +1944,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RemoveRule(string firewallPolicy, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RemoveRule(string firewallPolicy, gaxgrpc::CallSettings callSettings = null) => RemoveRule(new RemoveRuleFirewallPolicyRequest { FirewallPolicy = gax::GaxPreconditions.CheckNotNullOrEmpty(firewallPolicy, nameof(firewallPolicy)), @@ -1506,7 +1958,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RemoveRuleAsync(string firewallPolicy, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RemoveRuleAsync(string firewallPolicy, gaxgrpc::CallSettings callSettings = null) => RemoveRuleAsync(new RemoveRuleFirewallPolicyRequest { FirewallPolicy = gax::GaxPreconditions.CheckNotNullOrEmpty(firewallPolicy, nameof(firewallPolicy)), @@ -1520,7 +1972,7 @@ internal static FirewallPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RemoveRuleAsync(string firewallPolicy, st::CancellationToken cancellationToken) => + public virtual stt::Task> RemoveRuleAsync(string firewallPolicy, st::CancellationToken cancellationToken) => RemoveRuleAsync(firewallPolicy, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1730,6 +2182,16 @@ public FirewallPoliciesClientImpl(FirewallPolicies.FirewallPoliciesClient grpcCl GrpcClient = grpcClient; FirewallPoliciesSettings effectiveSettings = settings ?? FirewallPoliciesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + AddAssociationOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOrganizationOperations(), effectiveSettings.AddAssociationOperationsSettings); + AddRuleOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOrganizationOperations(), effectiveSettings.AddRuleOperationsSettings); + CloneRulesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOrganizationOperations(), effectiveSettings.CloneRulesOperationsSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOrganizationOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOrganizationOperations(), effectiveSettings.InsertOperationsSettings); + MoveOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOrganizationOperations(), effectiveSettings.MoveOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOrganizationOperations(), effectiveSettings.PatchOperationsSettings); + PatchRuleOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOrganizationOperations(), effectiveSettings.PatchRuleOperationsSettings); + RemoveAssociationOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOrganizationOperations(), effectiveSettings.RemoveAssociationOperationsSettings); + RemoveRuleOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOrganizationOperations(), effectiveSettings.RemoveRuleOperationsSettings); _callAddAssociation = clientHelper.BuildApiCall(grpcClient.AddAssociationAsync, grpcClient.AddAssociation, effectiveSettings.AddAssociationSettings).WithGoogleRequestParam("firewall_policy", request => request.FirewallPolicy); Modify_ApiCall(ref _callAddAssociation); Modify_AddAssociationApiCall(ref _callAddAssociation); @@ -1866,16 +2328,22 @@ public FirewallPoliciesClientImpl(FirewallPolicies.FirewallPoliciesClient grpcCl partial void Modify_TestIamPermissionsFirewallPolicyRequest(ref TestIamPermissionsFirewallPolicyRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for AddAssociation. + public override lro::OperationsClient AddAssociationOperationsClient { get; } + /// /// Inserts an association for the specified firewall policy. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation AddAssociation(AddAssociationFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation AddAssociation(AddAssociationFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddAssociationFirewallPolicyRequest(ref request, ref callSettings); - return _callAddAssociation.Sync(request, callSettings); + Operation response = _callAddAssociation.Sync(request, callSettings); + GetGlobalOrganizationOperationRequest pollRequest = GetGlobalOrganizationOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddAssociationOperationsClient); } /// @@ -1884,22 +2352,31 @@ public override Operation AddAssociation(AddAssociationFirewallPolicyRequest req /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task AddAssociationAsync(AddAssociationFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> AddAssociationAsync(AddAssociationFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddAssociationFirewallPolicyRequest(ref request, ref callSettings); - return _callAddAssociation.Async(request, callSettings); + Operation response = await _callAddAssociation.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOrganizationOperationRequest pollRequest = GetGlobalOrganizationOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddAssociationOperationsClient); } + /// The long-running operations client for AddRule. + public override lro::OperationsClient AddRuleOperationsClient { get; } + /// /// Inserts a rule into a firewall policy. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation AddRule(AddRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation AddRule(AddRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddRuleFirewallPolicyRequest(ref request, ref callSettings); - return _callAddRule.Sync(request, callSettings); + Operation response = _callAddRule.Sync(request, callSettings); + GetGlobalOrganizationOperationRequest pollRequest = GetGlobalOrganizationOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddRuleOperationsClient); } /// @@ -1908,22 +2385,31 @@ public override Operation AddRule(AddRuleFirewallPolicyRequest request, gaxgrpc: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task AddRuleAsync(AddRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> AddRuleAsync(AddRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddRuleFirewallPolicyRequest(ref request, ref callSettings); - return _callAddRule.Async(request, callSettings); + Operation response = await _callAddRule.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOrganizationOperationRequest pollRequest = GetGlobalOrganizationOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddRuleOperationsClient); } + /// The long-running operations client for CloneRules. + public override lro::OperationsClient CloneRulesOperationsClient { get; } + /// /// Copies rules to the specified firewall policy. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation CloneRules(CloneRulesFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation CloneRules(CloneRulesFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_CloneRulesFirewallPolicyRequest(ref request, ref callSettings); - return _callCloneRules.Sync(request, callSettings); + Operation response = _callCloneRules.Sync(request, callSettings); + GetGlobalOrganizationOperationRequest pollRequest = GetGlobalOrganizationOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), CloneRulesOperationsClient); } /// @@ -1932,22 +2418,31 @@ public override Operation CloneRules(CloneRulesFirewallPolicyRequest request, ga /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task CloneRulesAsync(CloneRulesFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> CloneRulesAsync(CloneRulesFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_CloneRulesFirewallPolicyRequest(ref request, ref callSettings); - return _callCloneRules.Async(request, callSettings); + Operation response = await _callCloneRules.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOrganizationOperationRequest pollRequest = GetGlobalOrganizationOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), CloneRulesOperationsClient); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified policy. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteFirewallPolicyRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOrganizationOperationRequest pollRequest = GetGlobalOrganizationOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1956,10 +2451,13 @@ public override Operation Delete(DeleteFirewallPolicyRequest request, gaxgrpc::C /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteFirewallPolicyRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOrganizationOperationRequest pollRequest = GetGlobalOrganizationOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -2058,16 +2556,22 @@ public override FirewallPolicyRule GetRule(GetRuleFirewallPolicyRequest request, return _callGetRule.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a new policy in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertFirewallPolicyRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOrganizationOperationRequest pollRequest = GetGlobalOrganizationOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -2076,10 +2580,13 @@ public override Operation Insert(InsertFirewallPolicyRequest request, gaxgrpc::C /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertFirewallPolicyRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOrganizationOperationRequest pollRequest = GetGlobalOrganizationOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -2130,16 +2637,22 @@ public override FirewallPoliciesListAssociationsResponse ListAssociations(ListAs return _callListAssociations.Async(request, callSettings); } + /// The long-running operations client for Move. + public override lro::OperationsClient MoveOperationsClient { get; } + /// /// Moves the specified firewall policy. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Move(MoveFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Move(MoveFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_MoveFirewallPolicyRequest(ref request, ref callSettings); - return _callMove.Sync(request, callSettings); + Operation response = _callMove.Sync(request, callSettings); + GetGlobalOrganizationOperationRequest pollRequest = GetGlobalOrganizationOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), MoveOperationsClient); } /// @@ -2148,22 +2661,31 @@ public override Operation Move(MoveFirewallPolicyRequest request, gaxgrpc::CallS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task MoveAsync(MoveFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> MoveAsync(MoveFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_MoveFirewallPolicyRequest(ref request, ref callSettings); - return _callMove.Async(request, callSettings); + Operation response = await _callMove.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOrganizationOperationRequest pollRequest = GetGlobalOrganizationOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), MoveOperationsClient); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Patches the specified policy with the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchFirewallPolicyRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetGlobalOrganizationOperationRequest pollRequest = GetGlobalOrganizationOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -2172,22 +2694,31 @@ public override Operation Patch(PatchFirewallPolicyRequest request, gaxgrpc::Cal /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchFirewallPolicyRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOrganizationOperationRequest pollRequest = GetGlobalOrganizationOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } + /// The long-running operations client for PatchRule. + public override lro::OperationsClient PatchRuleOperationsClient { get; } + /// /// Patches a rule of the specified priority. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation PatchRule(PatchRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation PatchRule(PatchRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchRuleFirewallPolicyRequest(ref request, ref callSettings); - return _callPatchRule.Sync(request, callSettings); + Operation response = _callPatchRule.Sync(request, callSettings); + GetGlobalOrganizationOperationRequest pollRequest = GetGlobalOrganizationOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchRuleOperationsClient); } /// @@ -2196,22 +2727,31 @@ public override Operation PatchRule(PatchRuleFirewallPolicyRequest request, gaxg /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchRuleAsync(PatchRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchRuleAsync(PatchRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchRuleFirewallPolicyRequest(ref request, ref callSettings); - return _callPatchRule.Async(request, callSettings); + Operation response = await _callPatchRule.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOrganizationOperationRequest pollRequest = GetGlobalOrganizationOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchRuleOperationsClient); } + /// The long-running operations client for RemoveAssociation. + public override lro::OperationsClient RemoveAssociationOperationsClient { get; } + /// /// Removes an association for the specified firewall policy. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation RemoveAssociation(RemoveAssociationFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation RemoveAssociation(RemoveAssociationFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RemoveAssociationFirewallPolicyRequest(ref request, ref callSettings); - return _callRemoveAssociation.Sync(request, callSettings); + Operation response = _callRemoveAssociation.Sync(request, callSettings); + GetGlobalOrganizationOperationRequest pollRequest = GetGlobalOrganizationOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RemoveAssociationOperationsClient); } /// @@ -2220,22 +2760,31 @@ public override Operation RemoveAssociation(RemoveAssociationFirewallPolicyReque /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task RemoveAssociationAsync(RemoveAssociationFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> RemoveAssociationAsync(RemoveAssociationFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RemoveAssociationFirewallPolicyRequest(ref request, ref callSettings); - return _callRemoveAssociation.Async(request, callSettings); + Operation response = await _callRemoveAssociation.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOrganizationOperationRequest pollRequest = GetGlobalOrganizationOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RemoveAssociationOperationsClient); } + /// The long-running operations client for RemoveRule. + public override lro::OperationsClient RemoveRuleOperationsClient { get; } + /// /// Deletes a rule of the specified priority. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation RemoveRule(RemoveRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation RemoveRule(RemoveRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RemoveRuleFirewallPolicyRequest(ref request, ref callSettings); - return _callRemoveRule.Sync(request, callSettings); + Operation response = _callRemoveRule.Sync(request, callSettings); + GetGlobalOrganizationOperationRequest pollRequest = GetGlobalOrganizationOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RemoveRuleOperationsClient); } /// @@ -2244,10 +2793,13 @@ public override Operation RemoveRule(RemoveRuleFirewallPolicyRequest request, ga /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task RemoveRuleAsync(RemoveRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> RemoveRuleAsync(RemoveRuleFirewallPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RemoveRuleFirewallPolicyRequest(ref request, ref callSettings); - return _callRemoveRule.Async(request, callSettings); + Operation response = await _callRemoveRule.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOrganizationOperationRequest pollRequest = GetGlobalOrganizationOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RemoveRuleOperationsClient); } /// @@ -2316,4 +2868,18 @@ public partial class FirewallPolicyList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class FirewallPolicies + { + public partial class FirewallPoliciesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOrganizationOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOrganizationOperations() => + GlobalOrganizationOperations.GlobalOrganizationOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/FirewallsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/FirewallsClient.g.cs index f4e9a404c15e..6e7bdc344b6e 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/FirewallsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/FirewallsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,11 +46,15 @@ private FirewallsSettings(FirewallsSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); UpdateSettings = existing.UpdateSettings; + UpdateOperationsSettings = existing.UpdateOperationsSettings.Clone(); OnCopy(existing); } @@ -67,6 +72,24 @@ private FirewallsSettings(FirewallsSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to FirewallsClient.Delete and + /// FirewallsClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to FirewallsClient.Get and /// FirewallsClient.GetAsync. @@ -91,6 +114,24 @@ private FirewallsSettings(FirewallsSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to FirewallsClient.Insert and + /// FirewallsClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to FirewallsClient.List /// and FirewallsClient.ListAsync. @@ -115,6 +156,24 @@ private FirewallsSettings(FirewallsSettings existing) : base(existing) /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to FirewallsClient.Patch and FirewallsClient.PatchAsync + /// . + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to FirewallsClient.Update /// and FirewallsClient.UpdateAsync. @@ -127,6 +186,24 @@ private FirewallsSettings(FirewallsSettings existing) : base(existing) /// public gaxgrpc::CallSettings UpdateSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to FirewallsClient.Update and + /// FirewallsClient.UpdateAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings UpdateOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public FirewallsSettings Clone() => new FirewallsSettings(this); @@ -295,7 +372,7 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteFirewallRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteFirewallRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -304,7 +381,7 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteFirewallRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteFirewallRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -313,9 +390,35 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteFirewallRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteFirewallRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified firewall. /// @@ -327,7 +430,7 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string firewall, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string firewall, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteFirewallRequest { Firewall = gax::GaxPreconditions.CheckNotNullOrEmpty(firewall, nameof(firewall)), @@ -345,7 +448,7 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string firewall, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string firewall, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteFirewallRequest { Firewall = gax::GaxPreconditions.CheckNotNullOrEmpty(firewall, nameof(firewall)), @@ -363,7 +466,7 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string firewall, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string firewall, st::CancellationToken cancellationToken) => DeleteAsync(project, firewall, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -449,7 +552,7 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertFirewallRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertFirewallRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -458,7 +561,7 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertFirewallRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertFirewallRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -467,9 +570,35 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertFirewallRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertFirewallRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a firewall rule in the specified project using the data included in the request. /// @@ -481,7 +610,7 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, Firewall firewallResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, Firewall firewallResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertFirewallRequest { FirewallResource = gax::GaxPreconditions.CheckNotNull(firewallResource, nameof(firewallResource)), @@ -499,7 +628,7 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, Firewall firewallResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, Firewall firewallResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertFirewallRequest { FirewallResource = gax::GaxPreconditions.CheckNotNull(firewallResource, nameof(firewallResource)), @@ -517,7 +646,7 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, Firewall firewallResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, Firewall firewallResource, st::CancellationToken cancellationToken) => InsertAsync(project, firewallResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -592,7 +721,7 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchFirewallRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchFirewallRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -601,7 +730,7 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchFirewallRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchFirewallRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -610,9 +739,35 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchFirewallRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchFirewallRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// @@ -627,7 +782,7 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string firewall, Firewall firewallResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string firewall, Firewall firewallResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchFirewallRequest { Firewall = gax::GaxPreconditions.CheckNotNullOrEmpty(firewall, nameof(firewall)), @@ -649,7 +804,7 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string firewall, Firewall firewallResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string firewall, Firewall firewallResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchFirewallRequest { Firewall = gax::GaxPreconditions.CheckNotNullOrEmpty(firewall, nameof(firewall)), @@ -671,7 +826,7 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string firewall, Firewall firewallResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string firewall, Firewall firewallResource, st::CancellationToken cancellationToken) => PatchAsync(project, firewall, firewallResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -680,7 +835,7 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(UpdateFirewallRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(UpdateFirewallRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -689,7 +844,7 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateFirewallRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(UpdateFirewallRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -698,9 +853,35 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateFirewallRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(UpdateFirewallRequest request, st::CancellationToken cancellationToken) => UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Update. + public virtual lro::OperationsClient UpdateOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Update. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceUpdate(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Update + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceUpdateAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + /// /// Updates the specified firewall rule with the data included in the request. Note that all fields will be updated if using PUT, even fields that are not specified. To update individual fields, please use PATCH instead. /// @@ -715,7 +896,7 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(string project, string firewall, Firewall firewallResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(string project, string firewall, Firewall firewallResource, gaxgrpc::CallSettings callSettings = null) => Update(new UpdateFirewallRequest { Firewall = gax::GaxPreconditions.CheckNotNullOrEmpty(firewall, nameof(firewall)), @@ -737,7 +918,7 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string firewall, Firewall firewallResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(string project, string firewall, Firewall firewallResource, gaxgrpc::CallSettings callSettings = null) => UpdateAsync(new UpdateFirewallRequest { Firewall = gax::GaxPreconditions.CheckNotNullOrEmpty(firewall, nameof(firewall)), @@ -759,7 +940,7 @@ internal static FirewallsClient Create(grpccore::CallInvoker callInvoker, Firewa /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string firewall, Firewall firewallResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(string project, string firewall, Firewall firewallResource, st::CancellationToken cancellationToken) => UpdateAsync(project, firewall, firewallResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -791,6 +972,10 @@ public FirewallsClientImpl(Firewalls.FirewallsClient grpcClient, FirewallsSettin GrpcClient = grpcClient; FirewallsSettings effectiveSettings = settings ?? FirewallsSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.PatchOperationsSettings); + UpdateOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.UpdateOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("firewall", request => request.Firewall); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -843,16 +1028,22 @@ public FirewallsClientImpl(Firewalls.FirewallsClient grpcClient, FirewallsSettin partial void Modify_UpdateFirewallRequest(ref UpdateFirewallRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified firewall. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteFirewallRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteFirewallRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteFirewallRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -861,10 +1052,13 @@ public override Operation Delete(DeleteFirewallRequest request, gaxgrpc::CallSet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteFirewallRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteFirewallRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteFirewallRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -891,16 +1085,22 @@ public override Firewall Get(GetFirewallRequest request, gaxgrpc::CallSettings c return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a firewall rule in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertFirewallRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertFirewallRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertFirewallRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -909,10 +1109,13 @@ public override Operation Insert(InsertFirewallRequest request, gaxgrpc::CallSet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertFirewallRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertFirewallRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertFirewallRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -939,16 +1142,22 @@ public override Operation Insert(InsertFirewallRequest request, gaxgrpc::CallSet return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchFirewallRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchFirewallRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchFirewallRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -957,22 +1166,31 @@ public override Operation Patch(PatchFirewallRequest request, gaxgrpc::CallSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchFirewallRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchFirewallRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchFirewallRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } + /// The long-running operations client for Update. + public override lro::OperationsClient UpdateOperationsClient { get; } + /// /// Updates the specified firewall rule with the data included in the request. Note that all fields will be updated if using PUT, even fields that are not specified. To update individual fields, please use PATCH instead. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Update(UpdateFirewallRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Update(UpdateFirewallRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateFirewallRequest(ref request, ref callSettings); - return _callUpdate.Sync(request, callSettings); + Operation response = _callUpdate.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } /// @@ -981,10 +1199,13 @@ public override Operation Update(UpdateFirewallRequest request, gaxgrpc::CallSet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task UpdateAsync(UpdateFirewallRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> UpdateAsync(UpdateFirewallRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateFirewallRequest(ref request, ref callSettings); - return _callUpdate.Async(request, callSettings); + Operation response = await _callUpdate.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } } @@ -1005,4 +1226,18 @@ public partial class FirewallList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class Firewalls + { + public partial class FirewallsClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ForwardingRulesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ForwardingRulesClient.g.cs index 0be37069b288..d0e2e4cb7710 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ForwardingRulesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ForwardingRulesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -46,12 +47,17 @@ private ForwardingRulesSettings(ForwardingRulesSettings existing) : base(existin gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); SetLabelsSettings = existing.SetLabelsSettings; + SetLabelsOperationsSettings = existing.SetLabelsOperationsSettings.Clone(); SetTargetSettings = existing.SetTargetSettings; + SetTargetOperationsSettings = existing.SetTargetOperationsSettings.Clone(); OnCopy(existing); } @@ -81,6 +87,24 @@ private ForwardingRulesSettings(ForwardingRulesSettings existing) : base(existin /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ForwardingRulesClient.Delete and + /// ForwardingRulesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to ForwardingRulesClient.Get /// and ForwardingRulesClient.GetAsync. @@ -105,6 +129,24 @@ private ForwardingRulesSettings(ForwardingRulesSettings existing) : base(existin /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ForwardingRulesClient.Insert and + /// ForwardingRulesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to ForwardingRulesClient.List /// and ForwardingRulesClient.ListAsync. @@ -129,6 +171,24 @@ private ForwardingRulesSettings(ForwardingRulesSettings existing) : base(existin /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ForwardingRulesClient.Patch and + /// ForwardingRulesClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// ForwardingRulesClient.SetLabels and ForwardingRulesClient.SetLabelsAsync. @@ -141,6 +201,24 @@ private ForwardingRulesSettings(ForwardingRulesSettings existing) : base(existin /// public gaxgrpc::CallSettings SetLabelsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ForwardingRulesClient.SetLabels and + /// ForwardingRulesClient.SetLabelsAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetLabelsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// ForwardingRulesClient.SetTarget and ForwardingRulesClient.SetTargetAsync. @@ -153,6 +231,24 @@ private ForwardingRulesSettings(ForwardingRulesSettings existing) : base(existin /// public gaxgrpc::CallSettings SetTargetSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ForwardingRulesClient.SetTarget and + /// ForwardingRulesClient.SetTargetAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetTargetOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public ForwardingRulesSettings Clone() => new ForwardingRulesSettings(this); @@ -392,7 +488,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -401,7 +497,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -410,9 +506,35 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteForwardingRuleRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteForwardingRuleRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified ForwardingRule resource. /// @@ -427,7 +549,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string forwardingRule, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string forwardingRule, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteForwardingRuleRequest { ForwardingRule = gax::GaxPreconditions.CheckNotNullOrEmpty(forwardingRule, nameof(forwardingRule)), @@ -449,7 +571,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string forwardingRule, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string forwardingRule, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteForwardingRuleRequest { ForwardingRule = gax::GaxPreconditions.CheckNotNullOrEmpty(forwardingRule, nameof(forwardingRule)), @@ -471,7 +593,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string forwardingRule, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string forwardingRule, st::CancellationToken cancellationToken) => DeleteAsync(project, region, forwardingRule, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -568,7 +690,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -577,7 +699,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -586,9 +708,35 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertForwardingRuleRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertForwardingRuleRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a ForwardingRule resource in the specified project and region using the data included in the request. /// @@ -603,7 +751,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, ForwardingRule forwardingRuleResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, ForwardingRule forwardingRuleResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertForwardingRuleRequest { ForwardingRuleResource = gax::GaxPreconditions.CheckNotNull(forwardingRuleResource, nameof(forwardingRuleResource)), @@ -625,7 +773,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, ForwardingRule forwardingRuleResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, ForwardingRule forwardingRuleResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertForwardingRuleRequest { ForwardingRuleResource = gax::GaxPreconditions.CheckNotNull(forwardingRuleResource, nameof(forwardingRuleResource)), @@ -647,7 +795,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, ForwardingRule forwardingRuleResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, ForwardingRule forwardingRuleResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, forwardingRuleResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -730,7 +878,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -739,7 +887,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -748,9 +896,35 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchForwardingRuleRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchForwardingRuleRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. /// @@ -768,7 +942,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string region, string forwardingRule, ForwardingRule forwardingRuleResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string region, string forwardingRule, ForwardingRule forwardingRuleResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchForwardingRuleRequest { ForwardingRule = gax::GaxPreconditions.CheckNotNullOrEmpty(forwardingRule, nameof(forwardingRule)), @@ -794,7 +968,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, string forwardingRule, ForwardingRule forwardingRuleResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string region, string forwardingRule, ForwardingRule forwardingRuleResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchForwardingRuleRequest { ForwardingRule = gax::GaxPreconditions.CheckNotNullOrEmpty(forwardingRule, nameof(forwardingRule)), @@ -820,7 +994,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, string forwardingRule, ForwardingRule forwardingRuleResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string region, string forwardingRule, ForwardingRule forwardingRuleResource, st::CancellationToken cancellationToken) => PatchAsync(project, region, forwardingRule, forwardingRuleResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -829,7 +1003,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetLabels(SetLabelsForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetLabels(SetLabelsForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -838,7 +1012,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(SetLabelsForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetLabelsAsync(SetLabelsForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -847,9 +1021,35 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(SetLabelsForwardingRuleRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetLabelsAsync(SetLabelsForwardingRuleRequest request, st::CancellationToken cancellationToken) => SetLabelsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetLabels. + public virtual lro::OperationsClient SetLabelsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetLabels. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetLabels(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetLabelsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetLabels. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetLabelsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetLabelsOperationsClient, callSettings); + /// /// Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation. /// @@ -867,7 +1067,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetLabels(string project, string region, string resource, RegionSetLabelsRequest regionSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetLabels(string project, string region, string resource, RegionSetLabelsRequest regionSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetLabels(new SetLabelsForwardingRuleRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -893,7 +1093,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(string project, string region, string resource, RegionSetLabelsRequest regionSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetLabelsAsync(string project, string region, string resource, RegionSetLabelsRequest regionSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetLabelsAsync(new SetLabelsForwardingRuleRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -919,7 +1119,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(string project, string region, string resource, RegionSetLabelsRequest regionSetLabelsRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetLabelsAsync(string project, string region, string resource, RegionSetLabelsRequest regionSetLabelsRequestResource, st::CancellationToken cancellationToken) => SetLabelsAsync(project, region, resource, regionSetLabelsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -928,7 +1128,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetTarget(SetTargetForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetTarget(SetTargetForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -937,7 +1137,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetTargetAsync(SetTargetForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetTargetAsync(SetTargetForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -946,9 +1146,35 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetTargetAsync(SetTargetForwardingRuleRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetTargetAsync(SetTargetForwardingRuleRequest request, st::CancellationToken cancellationToken) => SetTargetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetTarget. + public virtual lro::OperationsClient SetTargetOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetTarget. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetTarget(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetTargetOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetTarget. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetTargetAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetTargetOperationsClient, callSettings); + /// /// Changes target URL for forwarding rule. The new target should be of the same type as the old target. /// @@ -966,7 +1192,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetTarget(string project, string region, string forwardingRule, TargetReference targetReferenceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetTarget(string project, string region, string forwardingRule, TargetReference targetReferenceResource, gaxgrpc::CallSettings callSettings = null) => SetTarget(new SetTargetForwardingRuleRequest { ForwardingRule = gax::GaxPreconditions.CheckNotNullOrEmpty(forwardingRule, nameof(forwardingRule)), @@ -992,7 +1218,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetTargetAsync(string project, string region, string forwardingRule, TargetReference targetReferenceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetTargetAsync(string project, string region, string forwardingRule, TargetReference targetReferenceResource, gaxgrpc::CallSettings callSettings = null) => SetTargetAsync(new SetTargetForwardingRuleRequest { ForwardingRule = gax::GaxPreconditions.CheckNotNullOrEmpty(forwardingRule, nameof(forwardingRule)), @@ -1018,7 +1244,7 @@ internal static ForwardingRulesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetTargetAsync(string project, string region, string forwardingRule, TargetReference targetReferenceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetTargetAsync(string project, string region, string forwardingRule, TargetReference targetReferenceResource, st::CancellationToken cancellationToken) => SetTargetAsync(project, region, forwardingRule, targetReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -1054,6 +1280,11 @@ public ForwardingRulesClientImpl(ForwardingRules.ForwardingRulesClient grpcClien GrpcClient = grpcClient; ForwardingRulesSettings effectiveSettings = settings ?? ForwardingRulesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.PatchOperationsSettings); + SetLabelsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.SetLabelsOperationsSettings); + SetTargetOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.SetTargetOperationsSettings); _callAggregatedList = clientHelper.BuildApiCall(grpcClient.AggregatedListAsync, grpcClient.AggregatedList, effectiveSettings.AggregatedListSettings).WithGoogleRequestParam("project", request => request.Project); Modify_ApiCall(ref _callAggregatedList); Modify_AggregatedListApiCall(ref _callAggregatedList); @@ -1146,16 +1377,22 @@ public ForwardingRulesClientImpl(ForwardingRules.ForwardingRulesClient grpcClien return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified ForwardingRule resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteForwardingRuleRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1164,10 +1401,13 @@ public override Operation Delete(DeleteForwardingRuleRequest request, gaxgrpc::C /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteForwardingRuleRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1194,16 +1434,22 @@ public override ForwardingRule Get(GetForwardingRuleRequest request, gaxgrpc::Ca return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a ForwardingRule resource in the specified project and region using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertForwardingRuleRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1212,10 +1458,13 @@ public override Operation Insert(InsertForwardingRuleRequest request, gaxgrpc::C /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertForwardingRuleRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1242,16 +1491,22 @@ public override Operation Insert(InsertForwardingRuleRequest request, gaxgrpc::C return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchForwardingRuleRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1260,22 +1515,31 @@ public override Operation Patch(PatchForwardingRuleRequest request, gaxgrpc::Cal /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchForwardingRuleRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } + /// The long-running operations client for SetLabels. + public override lro::OperationsClient SetLabelsOperationsClient { get; } + /// /// Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetLabels(SetLabelsForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetLabels(SetLabelsForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetLabelsForwardingRuleRequest(ref request, ref callSettings); - return _callSetLabels.Sync(request, callSettings); + Operation response = _callSetLabels.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetLabelsOperationsClient); } /// @@ -1284,22 +1548,31 @@ public override Operation SetLabels(SetLabelsForwardingRuleRequest request, gaxg /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetLabelsAsync(SetLabelsForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetLabelsAsync(SetLabelsForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetLabelsForwardingRuleRequest(ref request, ref callSettings); - return _callSetLabels.Async(request, callSettings); + Operation response = await _callSetLabels.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetLabelsOperationsClient); } + /// The long-running operations client for SetTarget. + public override lro::OperationsClient SetTargetOperationsClient { get; } + /// /// Changes target URL for forwarding rule. The new target should be of the same type as the old target. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetTarget(SetTargetForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetTarget(SetTargetForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetTargetForwardingRuleRequest(ref request, ref callSettings); - return _callSetTarget.Sync(request, callSettings); + Operation response = _callSetTarget.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetTargetOperationsClient); } /// @@ -1308,10 +1581,13 @@ public override Operation SetTarget(SetTargetForwardingRuleRequest request, gaxg /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetTargetAsync(SetTargetForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetTargetAsync(SetTargetForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetTargetForwardingRuleRequest(ref request, ref callSettings); - return _callSetTarget.Async(request, callSettings); + Operation response = await _callSetTarget.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetTargetOperationsClient); } } @@ -1351,4 +1627,18 @@ public partial class ForwardingRuleList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class ForwardingRules + { + public partial class ForwardingRulesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalAddressesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalAddressesClient.g.cs index 77c0e8dabd71..b9b754d23ecd 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalAddressesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalAddressesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -44,8 +45,10 @@ private GlobalAddressesSettings(GlobalAddressesSettings existing) : base(existin { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; OnCopy(existing); } @@ -64,6 +67,24 @@ private GlobalAddressesSettings(GlobalAddressesSettings existing) : base(existin /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to GlobalAddressesClient.Delete and + /// GlobalAddressesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to GlobalAddressesClient.Get /// and GlobalAddressesClient.GetAsync. @@ -88,6 +109,24 @@ private GlobalAddressesSettings(GlobalAddressesSettings existing) : base(existin /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to GlobalAddressesClient.Insert and + /// GlobalAddressesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to GlobalAddressesClient.List /// and GlobalAddressesClient.ListAsync. @@ -269,7 +308,7 @@ internal static GlobalAddressesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteGlobalAddressRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteGlobalAddressRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -278,7 +317,7 @@ internal static GlobalAddressesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteGlobalAddressRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteGlobalAddressRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -287,9 +326,35 @@ internal static GlobalAddressesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteGlobalAddressRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteGlobalAddressRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified address resource. /// @@ -301,7 +366,7 @@ internal static GlobalAddressesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string address, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string address, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteGlobalAddressRequest { Address = gax::GaxPreconditions.CheckNotNullOrEmpty(address, nameof(address)), @@ -319,7 +384,7 @@ internal static GlobalAddressesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string address, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string address, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteGlobalAddressRequest { Address = gax::GaxPreconditions.CheckNotNullOrEmpty(address, nameof(address)), @@ -337,7 +402,7 @@ internal static GlobalAddressesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string address, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string address, st::CancellationToken cancellationToken) => DeleteAsync(project, address, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -423,7 +488,7 @@ internal static GlobalAddressesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertGlobalAddressRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertGlobalAddressRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -432,7 +497,7 @@ internal static GlobalAddressesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertGlobalAddressRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertGlobalAddressRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -441,9 +506,35 @@ internal static GlobalAddressesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertGlobalAddressRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertGlobalAddressRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates an address resource in the specified project by using the data included in the request. /// @@ -455,7 +546,7 @@ internal static GlobalAddressesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, Address addressResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, Address addressResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertGlobalAddressRequest { AddressResource = gax::GaxPreconditions.CheckNotNull(addressResource, nameof(addressResource)), @@ -473,7 +564,7 @@ internal static GlobalAddressesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, Address addressResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, Address addressResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertGlobalAddressRequest { AddressResource = gax::GaxPreconditions.CheckNotNull(addressResource, nameof(addressResource)), @@ -491,7 +582,7 @@ internal static GlobalAddressesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, Address addressResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, Address addressResource, st::CancellationToken cancellationToken) => InsertAsync(project, addressResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -585,6 +676,8 @@ public GlobalAddressesClientImpl(GlobalAddresses.GlobalAddressesClient grpcClien GrpcClient = grpcClient; GlobalAddressesSettings effectiveSettings = settings ?? GlobalAddressesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("address", request => request.Address); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -623,16 +716,22 @@ public GlobalAddressesClientImpl(GlobalAddresses.GlobalAddressesClient grpcClien partial void Modify_ListGlobalAddressesRequest(ref ListGlobalAddressesRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified address resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteGlobalAddressRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteGlobalAddressRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteGlobalAddressRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -641,10 +740,13 @@ public override Operation Delete(DeleteGlobalAddressRequest request, gaxgrpc::Ca /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteGlobalAddressRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteGlobalAddressRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteGlobalAddressRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -671,16 +773,22 @@ public override Address Get(GetGlobalAddressRequest request, gaxgrpc::CallSettin return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates an address resource in the specified project by using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertGlobalAddressRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertGlobalAddressRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertGlobalAddressRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -689,10 +797,13 @@ public override Operation Insert(InsertGlobalAddressRequest request, gaxgrpc::Ca /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertGlobalAddressRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertGlobalAddressRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertGlobalAddressRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -729,4 +840,18 @@ public int PageSize set => MaxResults = checked((uint)value); } } + + public static partial class GlobalAddresses + { + public partial class GlobalAddressesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalForwardingRulesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalForwardingRulesClient.g.cs index 43462cac8fcf..361e7754421f 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalForwardingRulesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalForwardingRulesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -46,12 +47,17 @@ private GlobalForwardingRulesSettings(GlobalForwardingRulesSettings existing) : { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); SetLabelsSettings = existing.SetLabelsSettings; + SetLabelsOperationsSettings = existing.SetLabelsOperationsSettings.Clone(); SetTargetSettings = existing.SetTargetSettings; + SetTargetOperationsSettings = existing.SetTargetOperationsSettings.Clone(); OnCopy(existing); } @@ -69,6 +75,24 @@ private GlobalForwardingRulesSettings(GlobalForwardingRulesSettings existing) : /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to GlobalForwardingRulesClient.Delete and + /// GlobalForwardingRulesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// GlobalForwardingRulesClient.Get and GlobalForwardingRulesClient.GetAsync. @@ -93,6 +117,24 @@ private GlobalForwardingRulesSettings(GlobalForwardingRulesSettings existing) : /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to GlobalForwardingRulesClient.Insert and + /// GlobalForwardingRulesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// GlobalForwardingRulesClient.List and GlobalForwardingRulesClient.ListAsync. @@ -117,6 +159,24 @@ private GlobalForwardingRulesSettings(GlobalForwardingRulesSettings existing) : /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to GlobalForwardingRulesClient.Patch and + /// GlobalForwardingRulesClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// GlobalForwardingRulesClient.SetLabels and GlobalForwardingRulesClient.SetLabelsAsync. @@ -129,6 +189,24 @@ private GlobalForwardingRulesSettings(GlobalForwardingRulesSettings existing) : /// public gaxgrpc::CallSettings SetLabelsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to GlobalForwardingRulesClient.SetLabels and + /// GlobalForwardingRulesClient.SetLabelsAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetLabelsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// GlobalForwardingRulesClient.SetTarget and GlobalForwardingRulesClient.SetTargetAsync. @@ -141,6 +219,24 @@ private GlobalForwardingRulesSettings(GlobalForwardingRulesSettings existing) : /// public gaxgrpc::CallSettings SetTargetSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to GlobalForwardingRulesClient.SetTarget and + /// GlobalForwardingRulesClient.SetTargetAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetTargetOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public GlobalForwardingRulesSettings Clone() => new GlobalForwardingRulesSettings(this); @@ -313,7 +409,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -322,7 +418,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -331,9 +427,35 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteGlobalForwardingRuleRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteGlobalForwardingRuleRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified GlobalForwardingRule resource. /// @@ -345,7 +467,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string forwardingRule, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string forwardingRule, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteGlobalForwardingRuleRequest { ForwardingRule = gax::GaxPreconditions.CheckNotNullOrEmpty(forwardingRule, nameof(forwardingRule)), @@ -363,7 +485,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string forwardingRule, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string forwardingRule, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteGlobalForwardingRuleRequest { ForwardingRule = gax::GaxPreconditions.CheckNotNullOrEmpty(forwardingRule, nameof(forwardingRule)), @@ -381,7 +503,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string forwardingRule, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string forwardingRule, st::CancellationToken cancellationToken) => DeleteAsync(project, forwardingRule, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -467,7 +589,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -476,7 +598,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -485,9 +607,35 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertGlobalForwardingRuleRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertGlobalForwardingRuleRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a GlobalForwardingRule resource in the specified project using the data included in the request. /// @@ -499,7 +647,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, ForwardingRule forwardingRuleResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, ForwardingRule forwardingRuleResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertGlobalForwardingRuleRequest { ForwardingRuleResource = gax::GaxPreconditions.CheckNotNull(forwardingRuleResource, nameof(forwardingRuleResource)), @@ -517,7 +665,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, ForwardingRule forwardingRuleResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, ForwardingRule forwardingRuleResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertGlobalForwardingRuleRequest { ForwardingRuleResource = gax::GaxPreconditions.CheckNotNull(forwardingRuleResource, nameof(forwardingRuleResource)), @@ -535,7 +683,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, ForwardingRule forwardingRuleResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, ForwardingRule forwardingRuleResource, st::CancellationToken cancellationToken) => InsertAsync(project, forwardingRuleResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -610,7 +758,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -619,7 +767,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -628,9 +776,35 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchGlobalForwardingRuleRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchGlobalForwardingRuleRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. /// @@ -645,7 +819,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string forwardingRule, ForwardingRule forwardingRuleResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string forwardingRule, ForwardingRule forwardingRuleResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchGlobalForwardingRuleRequest { ForwardingRule = gax::GaxPreconditions.CheckNotNullOrEmpty(forwardingRule, nameof(forwardingRule)), @@ -667,7 +841,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string forwardingRule, ForwardingRule forwardingRuleResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string forwardingRule, ForwardingRule forwardingRuleResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchGlobalForwardingRuleRequest { ForwardingRule = gax::GaxPreconditions.CheckNotNullOrEmpty(forwardingRule, nameof(forwardingRule)), @@ -689,7 +863,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string forwardingRule, ForwardingRule forwardingRuleResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string forwardingRule, ForwardingRule forwardingRuleResource, st::CancellationToken cancellationToken) => PatchAsync(project, forwardingRule, forwardingRuleResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -698,7 +872,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetLabels(SetLabelsGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetLabels(SetLabelsGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -707,7 +881,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(SetLabelsGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetLabelsAsync(SetLabelsGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -716,9 +890,35 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(SetLabelsGlobalForwardingRuleRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetLabelsAsync(SetLabelsGlobalForwardingRuleRequest request, st::CancellationToken cancellationToken) => SetLabelsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetLabels. + public virtual lro::OperationsClient SetLabelsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetLabels. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetLabels(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetLabelsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetLabels. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetLabelsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetLabelsOperationsClient, callSettings); + /// /// Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation. /// @@ -733,7 +933,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetLabels(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetLabels(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetLabels(new SetLabelsGlobalForwardingRuleRequest { GlobalSetLabelsRequestResource = gax::GaxPreconditions.CheckNotNull(globalSetLabelsRequestResource, nameof(globalSetLabelsRequestResource)), @@ -755,7 +955,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetLabelsAsync(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetLabelsAsync(new SetLabelsGlobalForwardingRuleRequest { GlobalSetLabelsRequestResource = gax::GaxPreconditions.CheckNotNull(globalSetLabelsRequestResource, nameof(globalSetLabelsRequestResource)), @@ -777,7 +977,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetLabelsAsync(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, st::CancellationToken cancellationToken) => SetLabelsAsync(project, resource, globalSetLabelsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -786,7 +986,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetTarget(SetTargetGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetTarget(SetTargetGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -795,7 +995,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetTargetAsync(SetTargetGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetTargetAsync(SetTargetGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -804,9 +1004,35 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetTargetAsync(SetTargetGlobalForwardingRuleRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetTargetAsync(SetTargetGlobalForwardingRuleRequest request, st::CancellationToken cancellationToken) => SetTargetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetTarget. + public virtual lro::OperationsClient SetTargetOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetTarget. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetTarget(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetTargetOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetTarget. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetTargetAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetTargetOperationsClient, callSettings); + /// /// Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. /// @@ -821,7 +1047,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetTarget(string project, string forwardingRule, TargetReference targetReferenceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetTarget(string project, string forwardingRule, TargetReference targetReferenceResource, gaxgrpc::CallSettings callSettings = null) => SetTarget(new SetTargetGlobalForwardingRuleRequest { ForwardingRule = gax::GaxPreconditions.CheckNotNullOrEmpty(forwardingRule, nameof(forwardingRule)), @@ -843,7 +1069,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetTargetAsync(string project, string forwardingRule, TargetReference targetReferenceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetTargetAsync(string project, string forwardingRule, TargetReference targetReferenceResource, gaxgrpc::CallSettings callSettings = null) => SetTargetAsync(new SetTargetGlobalForwardingRuleRequest { ForwardingRule = gax::GaxPreconditions.CheckNotNullOrEmpty(forwardingRule, nameof(forwardingRule)), @@ -865,7 +1091,7 @@ internal static GlobalForwardingRulesClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetTargetAsync(string project, string forwardingRule, TargetReference targetReferenceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetTargetAsync(string project, string forwardingRule, TargetReference targetReferenceResource, st::CancellationToken cancellationToken) => SetTargetAsync(project, forwardingRule, targetReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -900,6 +1126,11 @@ public GlobalForwardingRulesClientImpl(GlobalForwardingRules.GlobalForwardingRul GrpcClient = grpcClient; GlobalForwardingRulesSettings effectiveSettings = settings ?? GlobalForwardingRulesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.PatchOperationsSettings); + SetLabelsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.SetLabelsOperationsSettings); + SetTargetOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.SetTargetOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("forwarding_rule", request => request.ForwardingRule); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -959,16 +1190,22 @@ public GlobalForwardingRulesClientImpl(GlobalForwardingRules.GlobalForwardingRul partial void Modify_SetTargetGlobalForwardingRuleRequest(ref SetTargetGlobalForwardingRuleRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified GlobalForwardingRule resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteGlobalForwardingRuleRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -977,10 +1214,13 @@ public override Operation Delete(DeleteGlobalForwardingRuleRequest request, gaxg /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteGlobalForwardingRuleRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1007,16 +1247,22 @@ public override ForwardingRule Get(GetGlobalForwardingRuleRequest request, gaxgr return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a GlobalForwardingRule resource in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertGlobalForwardingRuleRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1025,10 +1271,13 @@ public override Operation Insert(InsertGlobalForwardingRuleRequest request, gaxg /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertGlobalForwardingRuleRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1055,16 +1304,22 @@ public override Operation Insert(InsertGlobalForwardingRuleRequest request, gaxg return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchGlobalForwardingRuleRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1073,22 +1328,31 @@ public override Operation Patch(PatchGlobalForwardingRuleRequest request, gaxgrp /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchGlobalForwardingRuleRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } + /// The long-running operations client for SetLabels. + public override lro::OperationsClient SetLabelsOperationsClient { get; } + /// /// Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetLabels(SetLabelsGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetLabels(SetLabelsGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetLabelsGlobalForwardingRuleRequest(ref request, ref callSettings); - return _callSetLabels.Sync(request, callSettings); + Operation response = _callSetLabels.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetLabelsOperationsClient); } /// @@ -1097,22 +1361,31 @@ public override Operation SetLabels(SetLabelsGlobalForwardingRuleRequest request /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetLabelsAsync(SetLabelsGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetLabelsAsync(SetLabelsGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetLabelsGlobalForwardingRuleRequest(ref request, ref callSettings); - return _callSetLabels.Async(request, callSettings); + Operation response = await _callSetLabels.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetLabelsOperationsClient); } + /// The long-running operations client for SetTarget. + public override lro::OperationsClient SetTargetOperationsClient { get; } + /// /// Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetTarget(SetTargetGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetTarget(SetTargetGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetTargetGlobalForwardingRuleRequest(ref request, ref callSettings); - return _callSetTarget.Sync(request, callSettings); + Operation response = _callSetTarget.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetTargetOperationsClient); } /// @@ -1121,10 +1394,13 @@ public override Operation SetTarget(SetTargetGlobalForwardingRuleRequest request /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetTargetAsync(SetTargetGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetTargetAsync(SetTargetGlobalForwardingRuleRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetTargetGlobalForwardingRuleRequest(ref request, ref callSettings); - return _callSetTarget.Async(request, callSettings); + Operation response = await _callSetTarget.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetTargetOperationsClient); } } @@ -1137,4 +1413,18 @@ public int PageSize set => MaxResults = checked((uint)value); } } + + public static partial class GlobalForwardingRules + { + public partial class GlobalForwardingRulesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalNetworkEndpointGroupsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalNetworkEndpointGroupsClient.g.cs index 216794ffc37d..bab9206a53bf 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalNetworkEndpointGroupsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalNetworkEndpointGroupsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -47,10 +48,14 @@ private GlobalNetworkEndpointGroupsSettings(GlobalNetworkEndpointGroupsSettings { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AttachNetworkEndpointsSettings = existing.AttachNetworkEndpointsSettings; + AttachNetworkEndpointsOperationsSettings = existing.AttachNetworkEndpointsOperationsSettings.Clone(); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); DetachNetworkEndpointsSettings = existing.DetachNetworkEndpointsSettings; + DetachNetworkEndpointsOperationsSettings = existing.DetachNetworkEndpointsOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; ListNetworkEndpointsSettings = existing.ListNetworkEndpointsSettings; OnCopy(existing); @@ -71,6 +76,24 @@ private GlobalNetworkEndpointGroupsSettings(GlobalNetworkEndpointGroupsSettings /// public gaxgrpc::CallSettings AttachNetworkEndpointsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to GlobalNetworkEndpointGroupsClient.AttachNetworkEndpoints + /// and GlobalNetworkEndpointGroupsClient.AttachNetworkEndpointsAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings AttachNetworkEndpointsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// GlobalNetworkEndpointGroupsClient.Delete and GlobalNetworkEndpointGroupsClient.DeleteAsync. @@ -83,6 +106,24 @@ private GlobalNetworkEndpointGroupsSettings(GlobalNetworkEndpointGroupsSettings /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to GlobalNetworkEndpointGroupsClient.Delete and + /// GlobalNetworkEndpointGroupsClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// GlobalNetworkEndpointGroupsClient.DetachNetworkEndpoints and @@ -96,6 +137,24 @@ private GlobalNetworkEndpointGroupsSettings(GlobalNetworkEndpointGroupsSettings /// public gaxgrpc::CallSettings DetachNetworkEndpointsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to GlobalNetworkEndpointGroupsClient.DetachNetworkEndpoints + /// and GlobalNetworkEndpointGroupsClient.DetachNetworkEndpointsAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DetachNetworkEndpointsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// GlobalNetworkEndpointGroupsClient.Get and GlobalNetworkEndpointGroupsClient.GetAsync. @@ -120,6 +179,24 @@ private GlobalNetworkEndpointGroupsSettings(GlobalNetworkEndpointGroupsSettings /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to GlobalNetworkEndpointGroupsClient.Insert and + /// GlobalNetworkEndpointGroupsClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// GlobalNetworkEndpointGroupsClient.List and GlobalNetworkEndpointGroupsClient.ListAsync. @@ -317,7 +394,7 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AttachNetworkEndpoints(AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AttachNetworkEndpoints(AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -326,7 +403,7 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AttachNetworkEndpointsAsync(AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AttachNetworkEndpointsAsync(AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -335,9 +412,36 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AttachNetworkEndpointsAsync(AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> AttachNetworkEndpointsAsync(AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest request, st::CancellationToken cancellationToken) => AttachNetworkEndpointsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for AttachNetworkEndpoints. + public virtual lro::OperationsClient AttachNetworkEndpointsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of + /// AttachNetworkEndpoints. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceAttachNetworkEndpoints(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AttachNetworkEndpointsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// AttachNetworkEndpoints. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceAttachNetworkEndpointsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AttachNetworkEndpointsOperationsClient, callSettings); + /// /// Attach a network endpoint to the specified network endpoint group. /// @@ -352,7 +456,7 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AttachNetworkEndpoints(string project, string networkEndpointGroup, GlobalNetworkEndpointGroupsAttachEndpointsRequest globalNetworkEndpointGroupsAttachEndpointsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AttachNetworkEndpoints(string project, string networkEndpointGroup, GlobalNetworkEndpointGroupsAttachEndpointsRequest globalNetworkEndpointGroupsAttachEndpointsRequestResource, gaxgrpc::CallSettings callSettings = null) => AttachNetworkEndpoints(new AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest { GlobalNetworkEndpointGroupsAttachEndpointsRequestResource = gax::GaxPreconditions.CheckNotNull(globalNetworkEndpointGroupsAttachEndpointsRequestResource, nameof(globalNetworkEndpointGroupsAttachEndpointsRequestResource)), @@ -374,7 +478,7 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AttachNetworkEndpointsAsync(string project, string networkEndpointGroup, GlobalNetworkEndpointGroupsAttachEndpointsRequest globalNetworkEndpointGroupsAttachEndpointsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AttachNetworkEndpointsAsync(string project, string networkEndpointGroup, GlobalNetworkEndpointGroupsAttachEndpointsRequest globalNetworkEndpointGroupsAttachEndpointsRequestResource, gaxgrpc::CallSettings callSettings = null) => AttachNetworkEndpointsAsync(new AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest { GlobalNetworkEndpointGroupsAttachEndpointsRequestResource = gax::GaxPreconditions.CheckNotNull(globalNetworkEndpointGroupsAttachEndpointsRequestResource, nameof(globalNetworkEndpointGroupsAttachEndpointsRequestResource)), @@ -396,7 +500,7 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AttachNetworkEndpointsAsync(string project, string networkEndpointGroup, GlobalNetworkEndpointGroupsAttachEndpointsRequest globalNetworkEndpointGroupsAttachEndpointsRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> AttachNetworkEndpointsAsync(string project, string networkEndpointGroup, GlobalNetworkEndpointGroupsAttachEndpointsRequest globalNetworkEndpointGroupsAttachEndpointsRequestResource, st::CancellationToken cancellationToken) => AttachNetworkEndpointsAsync(project, networkEndpointGroup, globalNetworkEndpointGroupsAttachEndpointsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -405,7 +509,7 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -414,7 +518,7 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -423,9 +527,35 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteGlobalNetworkEndpointGroupRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteGlobalNetworkEndpointGroupRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified network endpoint group.Note that the NEG cannot be deleted if there are backend services referencing it. /// @@ -437,7 +567,7 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string networkEndpointGroup, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string networkEndpointGroup, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteGlobalNetworkEndpointGroupRequest { NetworkEndpointGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(networkEndpointGroup, nameof(networkEndpointGroup)), @@ -455,7 +585,7 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string networkEndpointGroup, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string networkEndpointGroup, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteGlobalNetworkEndpointGroupRequest { NetworkEndpointGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(networkEndpointGroup, nameof(networkEndpointGroup)), @@ -473,7 +603,7 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string networkEndpointGroup, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string networkEndpointGroup, st::CancellationToken cancellationToken) => DeleteAsync(project, networkEndpointGroup, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -482,7 +612,7 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DetachNetworkEndpoints(DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DetachNetworkEndpoints(DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -491,7 +621,7 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DetachNetworkEndpointsAsync(DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DetachNetworkEndpointsAsync(DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -500,9 +630,36 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DetachNetworkEndpointsAsync(DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DetachNetworkEndpointsAsync(DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest request, st::CancellationToken cancellationToken) => DetachNetworkEndpointsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for DetachNetworkEndpoints. + public virtual lro::OperationsClient DetachNetworkEndpointsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of + /// DetachNetworkEndpoints. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDetachNetworkEndpoints(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DetachNetworkEndpointsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// DetachNetworkEndpoints. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDetachNetworkEndpointsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DetachNetworkEndpointsOperationsClient, callSettings); + /// /// Detach the network endpoint from the specified network endpoint group. /// @@ -517,7 +674,7 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DetachNetworkEndpoints(string project, string networkEndpointGroup, GlobalNetworkEndpointGroupsDetachEndpointsRequest globalNetworkEndpointGroupsDetachEndpointsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DetachNetworkEndpoints(string project, string networkEndpointGroup, GlobalNetworkEndpointGroupsDetachEndpointsRequest globalNetworkEndpointGroupsDetachEndpointsRequestResource, gaxgrpc::CallSettings callSettings = null) => DetachNetworkEndpoints(new DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest { GlobalNetworkEndpointGroupsDetachEndpointsRequestResource = gax::GaxPreconditions.CheckNotNull(globalNetworkEndpointGroupsDetachEndpointsRequestResource, nameof(globalNetworkEndpointGroupsDetachEndpointsRequestResource)), @@ -539,7 +696,7 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DetachNetworkEndpointsAsync(string project, string networkEndpointGroup, GlobalNetworkEndpointGroupsDetachEndpointsRequest globalNetworkEndpointGroupsDetachEndpointsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DetachNetworkEndpointsAsync(string project, string networkEndpointGroup, GlobalNetworkEndpointGroupsDetachEndpointsRequest globalNetworkEndpointGroupsDetachEndpointsRequestResource, gaxgrpc::CallSettings callSettings = null) => DetachNetworkEndpointsAsync(new DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest { GlobalNetworkEndpointGroupsDetachEndpointsRequestResource = gax::GaxPreconditions.CheckNotNull(globalNetworkEndpointGroupsDetachEndpointsRequestResource, nameof(globalNetworkEndpointGroupsDetachEndpointsRequestResource)), @@ -561,7 +718,7 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DetachNetworkEndpointsAsync(string project, string networkEndpointGroup, GlobalNetworkEndpointGroupsDetachEndpointsRequest globalNetworkEndpointGroupsDetachEndpointsRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> DetachNetworkEndpointsAsync(string project, string networkEndpointGroup, GlobalNetworkEndpointGroupsDetachEndpointsRequest globalNetworkEndpointGroupsDetachEndpointsRequestResource, st::CancellationToken cancellationToken) => DetachNetworkEndpointsAsync(project, networkEndpointGroup, globalNetworkEndpointGroupsDetachEndpointsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -647,7 +804,7 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -656,7 +813,7 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -665,9 +822,35 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertGlobalNetworkEndpointGroupRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertGlobalNetworkEndpointGroupRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a network endpoint group in the specified project using the parameters that are included in the request. /// @@ -679,7 +862,7 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, NetworkEndpointGroup networkEndpointGroupResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, NetworkEndpointGroup networkEndpointGroupResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertGlobalNetworkEndpointGroupRequest { NetworkEndpointGroupResource = gax::GaxPreconditions.CheckNotNull(networkEndpointGroupResource, nameof(networkEndpointGroupResource)), @@ -697,7 +880,7 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, NetworkEndpointGroup networkEndpointGroupResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, NetworkEndpointGroup networkEndpointGroupResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertGlobalNetworkEndpointGroupRequest { NetworkEndpointGroupResource = gax::GaxPreconditions.CheckNotNull(networkEndpointGroupResource, nameof(networkEndpointGroupResource)), @@ -715,7 +898,7 @@ internal static GlobalNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, NetworkEndpointGroup networkEndpointGroupResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, NetworkEndpointGroup networkEndpointGroupResource, st::CancellationToken cancellationToken) => InsertAsync(project, networkEndpointGroupResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -896,6 +1079,10 @@ public GlobalNetworkEndpointGroupsClientImpl(GlobalNetworkEndpointGroups.GlobalN GrpcClient = grpcClient; GlobalNetworkEndpointGroupsSettings effectiveSettings = settings ?? GlobalNetworkEndpointGroupsSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + AttachNetworkEndpointsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.AttachNetworkEndpointsOperationsSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + DetachNetworkEndpointsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DetachNetworkEndpointsOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); _callAttachNetworkEndpoints = clientHelper.BuildApiCall(grpcClient.AttachNetworkEndpointsAsync, grpcClient.AttachNetworkEndpoints, effectiveSettings.AttachNetworkEndpointsSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("network_endpoint_group", request => request.NetworkEndpointGroup); Modify_ApiCall(ref _callAttachNetworkEndpoints); Modify_AttachNetworkEndpointsApiCall(ref _callAttachNetworkEndpoints); @@ -955,16 +1142,22 @@ public GlobalNetworkEndpointGroupsClientImpl(GlobalNetworkEndpointGroups.GlobalN partial void Modify_ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest(ref ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for AttachNetworkEndpoints. + public override lro::OperationsClient AttachNetworkEndpointsOperationsClient { get; } + /// /// Attach a network endpoint to the specified network endpoint group. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation AttachNetworkEndpoints(AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation AttachNetworkEndpoints(AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest(ref request, ref callSettings); - return _callAttachNetworkEndpoints.Sync(request, callSettings); + Operation response = _callAttachNetworkEndpoints.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AttachNetworkEndpointsOperationsClient); } /// @@ -973,22 +1166,31 @@ public override Operation AttachNetworkEndpoints(AttachNetworkEndpointsGlobalNet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task AttachNetworkEndpointsAsync(AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> AttachNetworkEndpointsAsync(AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest(ref request, ref callSettings); - return _callAttachNetworkEndpoints.Async(request, callSettings); + Operation response = await _callAttachNetworkEndpoints.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AttachNetworkEndpointsOperationsClient); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified network endpoint group.Note that the NEG cannot be deleted if there are backend services referencing it. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteGlobalNetworkEndpointGroupRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -997,22 +1199,31 @@ public override Operation Delete(DeleteGlobalNetworkEndpointGroupRequest request /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteGlobalNetworkEndpointGroupRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } + /// The long-running operations client for DetachNetworkEndpoints. + public override lro::OperationsClient DetachNetworkEndpointsOperationsClient { get; } + /// /// Detach the network endpoint from the specified network endpoint group. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation DetachNetworkEndpoints(DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation DetachNetworkEndpoints(DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest(ref request, ref callSettings); - return _callDetachNetworkEndpoints.Sync(request, callSettings); + Operation response = _callDetachNetworkEndpoints.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DetachNetworkEndpointsOperationsClient); } /// @@ -1021,10 +1232,13 @@ public override Operation DetachNetworkEndpoints(DetachNetworkEndpointsGlobalNet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DetachNetworkEndpointsAsync(DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DetachNetworkEndpointsAsync(DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest(ref request, ref callSettings); - return _callDetachNetworkEndpoints.Async(request, callSettings); + Operation response = await _callDetachNetworkEndpoints.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DetachNetworkEndpointsOperationsClient); } /// @@ -1051,16 +1265,22 @@ public override NetworkEndpointGroup Get(GetGlobalNetworkEndpointGroupRequest re return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a network endpoint group in the specified project using the parameters that are included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertGlobalNetworkEndpointGroupRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1069,10 +1289,13 @@ public override Operation Insert(InsertGlobalNetworkEndpointGroupRequest request /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertGlobalNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertGlobalNetworkEndpointGroupRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1161,4 +1384,18 @@ public partial class NetworkEndpointGroupsListNetworkEndpoints : gaxgrpc::IPageR sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class GlobalNetworkEndpointGroups + { + public partial class GlobalNetworkEndpointGroupsClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalOperationsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalOperationsClient.g.cs index d0d2d5ac1003..2f331b923d6f 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalOperationsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalOperationsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -906,4 +907,21 @@ public partial class OperationList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class GlobalOperations + { + public partial class GlobalOperationsClient + { + /// + /// Creates a new instance of using the specified call + /// invoker, but redirecting Google.LongRunning RPCs to GlobalOperations RPCs. + /// + /// A new Operations client for the same target as this client. + internal static lro::Operations.OperationsClient CreateOperationsClient(grpccore::CallInvoker callInvoker) + { + grpccore::CallInvoker forwardingCallInvoker = gaxgrpc::ForwardingCallInvoker.Create(callInvoker, "/google.longrunning.Operations/GetOperation", __Method_Get, GetGlobalOperationRequest.ParseLroRequest, (request, response) => response.ToLroResponse(request.Name)); + return new lro::Operations.OperationsClient(forwardingCallInvoker); + } + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalOrganizationOperationsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalOrganizationOperationsClient.g.cs index cad1c2234a5d..257ddc7a200e 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalOrganizationOperationsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalOrganizationOperationsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -584,4 +585,21 @@ public int PageSize set => MaxResults = checked((uint)value); } } + + public static partial class GlobalOrganizationOperations + { + public partial class GlobalOrganizationOperationsClient + { + /// + /// Creates a new instance of using the specified call + /// invoker, but redirecting Google.LongRunning RPCs to GlobalOrganizationOperations RPCs. + /// + /// A new Operations client for the same target as this client. + internal static lro::Operations.OperationsClient CreateOperationsClient(grpccore::CallInvoker callInvoker) + { + grpccore::CallInvoker forwardingCallInvoker = gaxgrpc::ForwardingCallInvoker.Create(callInvoker, "/google.longrunning.Operations/GetOperation", __Method_Get, GetGlobalOrganizationOperationRequest.ParseLroRequest, (request, response) => response.ToLroResponse(request.Name)); + return new lro::Operations.OperationsClient(forwardingCallInvoker); + } + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalPublicDelegatedPrefixesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalPublicDelegatedPrefixesClient.g.cs index c9819263bb21..3fd80c621dfe 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalPublicDelegatedPrefixesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/GlobalPublicDelegatedPrefixesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -47,10 +48,13 @@ private GlobalPublicDelegatedPrefixesSettings(GlobalPublicDelegatedPrefixesSetti { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); OnCopy(existing); } @@ -69,6 +73,24 @@ private GlobalPublicDelegatedPrefixesSettings(GlobalPublicDelegatedPrefixesSetti /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to GlobalPublicDelegatedPrefixesClient.Delete and + /// GlobalPublicDelegatedPrefixesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// GlobalPublicDelegatedPrefixesClient.Get and GlobalPublicDelegatedPrefixesClient.GetAsync. @@ -94,6 +116,24 @@ private GlobalPublicDelegatedPrefixesSettings(GlobalPublicDelegatedPrefixesSetti /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to GlobalPublicDelegatedPrefixesClient.Insert and + /// GlobalPublicDelegatedPrefixesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// GlobalPublicDelegatedPrefixesClient.List and GlobalPublicDelegatedPrefixesClient.ListAsync. @@ -118,6 +158,24 @@ private GlobalPublicDelegatedPrefixesSettings(GlobalPublicDelegatedPrefixesSetti /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to GlobalPublicDelegatedPrefixesClient.Patch and + /// GlobalPublicDelegatedPrefixesClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public GlobalPublicDelegatedPrefixesSettings Clone() => new GlobalPublicDelegatedPrefixesSettings(this); @@ -292,7 +350,7 @@ internal static GlobalPublicDelegatedPrefixesClient Create(grpccore::CallInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -301,7 +359,7 @@ internal static GlobalPublicDelegatedPrefixesClient Create(grpccore::CallInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -310,9 +368,35 @@ internal static GlobalPublicDelegatedPrefixesClient Create(grpccore::CallInvoker /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteGlobalPublicDelegatedPrefixeRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteGlobalPublicDelegatedPrefixeRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified global PublicDelegatedPrefix. /// @@ -324,7 +408,7 @@ internal static GlobalPublicDelegatedPrefixesClient Create(grpccore::CallInvoker /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string publicDelegatedPrefix, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string publicDelegatedPrefix, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteGlobalPublicDelegatedPrefixeRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -342,7 +426,7 @@ internal static GlobalPublicDelegatedPrefixesClient Create(grpccore::CallInvoker /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string publicDelegatedPrefix, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string publicDelegatedPrefix, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteGlobalPublicDelegatedPrefixeRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -360,7 +444,7 @@ internal static GlobalPublicDelegatedPrefixesClient Create(grpccore::CallInvoker /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string publicDelegatedPrefix, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string publicDelegatedPrefix, st::CancellationToken cancellationToken) => DeleteAsync(project, publicDelegatedPrefix, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -446,7 +530,7 @@ internal static GlobalPublicDelegatedPrefixesClient Create(grpccore::CallInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -455,7 +539,7 @@ internal static GlobalPublicDelegatedPrefixesClient Create(grpccore::CallInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -464,9 +548,35 @@ internal static GlobalPublicDelegatedPrefixesClient Create(grpccore::CallInvoker /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertGlobalPublicDelegatedPrefixeRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertGlobalPublicDelegatedPrefixeRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a global PublicDelegatedPrefix in the specified project using the parameters that are included in the request. /// @@ -478,7 +588,7 @@ internal static GlobalPublicDelegatedPrefixesClient Create(grpccore::CallInvoker /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, PublicDelegatedPrefix publicDelegatedPrefixResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, PublicDelegatedPrefix publicDelegatedPrefixResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertGlobalPublicDelegatedPrefixeRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -496,7 +606,7 @@ internal static GlobalPublicDelegatedPrefixesClient Create(grpccore::CallInvoker /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, PublicDelegatedPrefix publicDelegatedPrefixResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, PublicDelegatedPrefix publicDelegatedPrefixResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertGlobalPublicDelegatedPrefixeRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -514,7 +624,7 @@ internal static GlobalPublicDelegatedPrefixesClient Create(grpccore::CallInvoker /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, PublicDelegatedPrefix publicDelegatedPrefixResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, PublicDelegatedPrefix publicDelegatedPrefixResource, st::CancellationToken cancellationToken) => InsertAsync(project, publicDelegatedPrefixResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -589,7 +699,7 @@ internal static GlobalPublicDelegatedPrefixesClient Create(grpccore::CallInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -598,7 +708,7 @@ internal static GlobalPublicDelegatedPrefixesClient Create(grpccore::CallInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -607,9 +717,35 @@ internal static GlobalPublicDelegatedPrefixesClient Create(grpccore::CallInvoker /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchGlobalPublicDelegatedPrefixeRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchGlobalPublicDelegatedPrefixeRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Patches the specified global PublicDelegatedPrefix resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. /// @@ -624,7 +760,7 @@ internal static GlobalPublicDelegatedPrefixesClient Create(grpccore::CallInvoker /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string publicDelegatedPrefix, PublicDelegatedPrefix publicDelegatedPrefixResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string publicDelegatedPrefix, PublicDelegatedPrefix publicDelegatedPrefixResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchGlobalPublicDelegatedPrefixeRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -646,7 +782,7 @@ internal static GlobalPublicDelegatedPrefixesClient Create(grpccore::CallInvoker /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string publicDelegatedPrefix, PublicDelegatedPrefix publicDelegatedPrefixResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string publicDelegatedPrefix, PublicDelegatedPrefix publicDelegatedPrefixResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchGlobalPublicDelegatedPrefixeRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -668,7 +804,7 @@ internal static GlobalPublicDelegatedPrefixesClient Create(grpccore::CallInvoker /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string publicDelegatedPrefix, PublicDelegatedPrefix publicDelegatedPrefixResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string publicDelegatedPrefix, PublicDelegatedPrefix publicDelegatedPrefixResource, st::CancellationToken cancellationToken) => PatchAsync(project, publicDelegatedPrefix, publicDelegatedPrefixResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -701,6 +837,9 @@ public GlobalPublicDelegatedPrefixesClientImpl(GlobalPublicDelegatedPrefixes.Glo GrpcClient = grpcClient; GlobalPublicDelegatedPrefixesSettings effectiveSettings = settings ?? GlobalPublicDelegatedPrefixesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.PatchOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("public_delegated_prefix", request => request.PublicDelegatedPrefix); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -746,16 +885,22 @@ public GlobalPublicDelegatedPrefixesClientImpl(GlobalPublicDelegatedPrefixes.Glo partial void Modify_PatchGlobalPublicDelegatedPrefixeRequest(ref PatchGlobalPublicDelegatedPrefixeRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified global PublicDelegatedPrefix. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteGlobalPublicDelegatedPrefixeRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -764,10 +909,13 @@ public override Operation Delete(DeleteGlobalPublicDelegatedPrefixeRequest reque /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteGlobalPublicDelegatedPrefixeRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -794,16 +942,22 @@ public override PublicDelegatedPrefix Get(GetGlobalPublicDelegatedPrefixeRequest return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a global PublicDelegatedPrefix in the specified project using the parameters that are included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertGlobalPublicDelegatedPrefixeRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -812,10 +966,13 @@ public override Operation Insert(InsertGlobalPublicDelegatedPrefixeRequest reque /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertGlobalPublicDelegatedPrefixeRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -842,16 +999,22 @@ public override Operation Insert(InsertGlobalPublicDelegatedPrefixeRequest reque return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Patches the specified global PublicDelegatedPrefix resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchGlobalPublicDelegatedPrefixeRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -860,10 +1023,13 @@ public override Operation Patch(PatchGlobalPublicDelegatedPrefixeRequest request /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchGlobalPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchGlobalPublicDelegatedPrefixeRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } } @@ -884,4 +1050,18 @@ public partial class PublicDelegatedPrefixList : gaxgrpc::IPageResponse GetEnumerator(); } + + public static partial class GlobalPublicDelegatedPrefixes + { + public partial class GlobalPublicDelegatedPrefixesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/HealthChecksClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/HealthChecksClient.g.cs index b0a5bfafe4a6..e24f2557a079 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/HealthChecksClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/HealthChecksClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -46,11 +47,15 @@ private HealthChecksSettings(HealthChecksSettings existing) : base(existing) gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); UpdateSettings = existing.UpdateSettings; + UpdateOperationsSettings = existing.UpdateOperationsSettings.Clone(); OnCopy(existing); } @@ -80,6 +85,24 @@ private HealthChecksSettings(HealthChecksSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to HealthChecksClient.Delete and + /// HealthChecksClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to HealthChecksClient.Get /// and HealthChecksClient.GetAsync. @@ -104,6 +127,24 @@ private HealthChecksSettings(HealthChecksSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to HealthChecksClient.Insert and + /// HealthChecksClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to HealthChecksClient.List /// and HealthChecksClient.ListAsync. @@ -128,6 +169,24 @@ private HealthChecksSettings(HealthChecksSettings existing) : base(existing) /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to HealthChecksClient.Patch and + /// HealthChecksClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to HealthChecksClient.Update /// and HealthChecksClient.UpdateAsync. @@ -140,6 +199,24 @@ private HealthChecksSettings(HealthChecksSettings existing) : base(existing) /// public gaxgrpc::CallSettings UpdateSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to HealthChecksClient.Update and + /// HealthChecksClient.UpdateAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings UpdateOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public HealthChecksSettings Clone() => new HealthChecksSettings(this); @@ -378,7 +455,7 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -387,7 +464,7 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -396,9 +473,35 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteHealthCheckRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteHealthCheckRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified HealthCheck resource. /// @@ -410,7 +513,7 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string healthCheck, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string healthCheck, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteHealthCheckRequest { HealthCheck = gax::GaxPreconditions.CheckNotNullOrEmpty(healthCheck, nameof(healthCheck)), @@ -428,7 +531,7 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string healthCheck, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string healthCheck, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteHealthCheckRequest { HealthCheck = gax::GaxPreconditions.CheckNotNullOrEmpty(healthCheck, nameof(healthCheck)), @@ -446,7 +549,7 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string healthCheck, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string healthCheck, st::CancellationToken cancellationToken) => DeleteAsync(project, healthCheck, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -532,7 +635,7 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -541,7 +644,7 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -550,9 +653,35 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertHealthCheckRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertHealthCheckRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a HealthCheck resource in the specified project using the data included in the request. /// @@ -564,7 +693,7 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertHealthCheckRequest { HealthCheckResource = gax::GaxPreconditions.CheckNotNull(healthCheckResource, nameof(healthCheckResource)), @@ -582,7 +711,7 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertHealthCheckRequest { HealthCheckResource = gax::GaxPreconditions.CheckNotNull(healthCheckResource, nameof(healthCheckResource)), @@ -600,7 +729,7 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, HealthCheck healthCheckResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, HealthCheck healthCheckResource, st::CancellationToken cancellationToken) => InsertAsync(project, healthCheckResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -675,7 +804,7 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -684,7 +813,7 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -693,9 +822,35 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchHealthCheckRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchHealthCheckRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// @@ -710,7 +865,7 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string healthCheck, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string healthCheck, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchHealthCheckRequest { HealthCheck = gax::GaxPreconditions.CheckNotNullOrEmpty(healthCheck, nameof(healthCheck)), @@ -732,7 +887,7 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string healthCheck, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string healthCheck, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchHealthCheckRequest { HealthCheck = gax::GaxPreconditions.CheckNotNullOrEmpty(healthCheck, nameof(healthCheck)), @@ -754,7 +909,7 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string healthCheck, HealthCheck healthCheckResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string healthCheck, HealthCheck healthCheckResource, st::CancellationToken cancellationToken) => PatchAsync(project, healthCheck, healthCheckResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -763,7 +918,7 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(UpdateHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(UpdateHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -772,7 +927,7 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(UpdateHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -781,9 +936,35 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateHealthCheckRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(UpdateHealthCheckRequest request, st::CancellationToken cancellationToken) => UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Update. + public virtual lro::OperationsClient UpdateOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Update. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceUpdate(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Update + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceUpdateAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + /// /// Updates a HealthCheck resource in the specified project using the data included in the request. /// @@ -798,7 +979,7 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(string project, string healthCheck, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(string project, string healthCheck, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => Update(new UpdateHealthCheckRequest { HealthCheck = gax::GaxPreconditions.CheckNotNullOrEmpty(healthCheck, nameof(healthCheck)), @@ -820,7 +1001,7 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string healthCheck, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(string project, string healthCheck, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => UpdateAsync(new UpdateHealthCheckRequest { HealthCheck = gax::GaxPreconditions.CheckNotNullOrEmpty(healthCheck, nameof(healthCheck)), @@ -842,7 +1023,7 @@ internal static HealthChecksClient Create(grpccore::CallInvoker callInvoker, Hea /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string healthCheck, HealthCheck healthCheckResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(string project, string healthCheck, HealthCheck healthCheckResource, st::CancellationToken cancellationToken) => UpdateAsync(project, healthCheck, healthCheckResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -876,6 +1057,10 @@ public HealthChecksClientImpl(HealthChecks.HealthChecksClient grpcClient, Health GrpcClient = grpcClient; HealthChecksSettings effectiveSettings = settings ?? HealthChecksSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.PatchOperationsSettings); + UpdateOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.UpdateOperationsSettings); _callAggregatedList = clientHelper.BuildApiCall(grpcClient.AggregatedListAsync, grpcClient.AggregatedList, effectiveSettings.AggregatedListSettings).WithGoogleRequestParam("project", request => request.Project); Modify_ApiCall(ref _callAggregatedList); Modify_AggregatedListApiCall(ref _callAggregatedList); @@ -961,16 +1146,22 @@ public HealthChecksClientImpl(HealthChecks.HealthChecksClient grpcClient, Health return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified HealthCheck resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteHealthCheckRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -979,10 +1170,13 @@ public override Operation Delete(DeleteHealthCheckRequest request, gaxgrpc::Call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteHealthCheckRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1009,16 +1203,22 @@ public override HealthCheck Get(GetHealthCheckRequest request, gaxgrpc::CallSett return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a HealthCheck resource in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertHealthCheckRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1027,10 +1227,13 @@ public override Operation Insert(InsertHealthCheckRequest request, gaxgrpc::Call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertHealthCheckRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1057,16 +1260,22 @@ public override Operation Insert(InsertHealthCheckRequest request, gaxgrpc::Call return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchHealthCheckRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1075,22 +1284,31 @@ public override Operation Patch(PatchHealthCheckRequest request, gaxgrpc::CallSe /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchHealthCheckRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } + /// The long-running operations client for Update. + public override lro::OperationsClient UpdateOperationsClient { get; } + /// /// Updates a HealthCheck resource in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Update(UpdateHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Update(UpdateHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateHealthCheckRequest(ref request, ref callSettings); - return _callUpdate.Sync(request, callSettings); + Operation response = _callUpdate.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } /// @@ -1099,10 +1317,13 @@ public override Operation Update(UpdateHealthCheckRequest request, gaxgrpc::Call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task UpdateAsync(UpdateHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> UpdateAsync(UpdateHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateHealthCheckRequest(ref request, ref callSettings); - return _callUpdate.Async(request, callSettings); + Operation response = await _callUpdate.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } } @@ -1141,4 +1362,18 @@ public partial class HealthCheckList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class HealthChecks + { + public partial class HealthChecksClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ImagesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ImagesClient.g.cs index 078a2fa2ba98..5813f49f1397 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ImagesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ImagesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,15 +46,20 @@ private ImagesSettings(ImagesSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); DeprecateSettings = existing.DeprecateSettings; + DeprecateOperationsSettings = existing.DeprecateOperationsSettings.Clone(); GetSettings = existing.GetSettings; GetFromFamilySettings = existing.GetFromFamilySettings; GetIamPolicySettings = existing.GetIamPolicySettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); SetIamPolicySettings = existing.SetIamPolicySettings; SetLabelsSettings = existing.SetLabelsSettings; + SetLabelsOperationsSettings = existing.SetLabelsOperationsSettings.Clone(); TestIamPermissionsSettings = existing.TestIamPermissionsSettings; OnCopy(existing); } @@ -72,6 +78,23 @@ private ImagesSettings(ImagesSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ImagesClient.Delete and ImagesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to ImagesClient.Deprecate /// and ImagesClient.DeprecateAsync. @@ -84,6 +107,24 @@ private ImagesSettings(ImagesSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeprecateSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ImagesClient.Deprecate and + /// ImagesClient.DeprecateAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeprecateOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to ImagesClient.Get and /// ImagesClient.GetAsync. @@ -132,6 +173,23 @@ private ImagesSettings(ImagesSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ImagesClient.Insert and ImagesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to ImagesClient.List and /// ImagesClient.ListAsync. @@ -156,6 +214,23 @@ private ImagesSettings(ImagesSettings existing) : base(existing) /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ImagesClient.Patch and ImagesClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to ImagesClient.SetIamPolicy /// and ImagesClient.SetIamPolicyAsync. @@ -180,6 +255,24 @@ private ImagesSettings(ImagesSettings existing) : base(existing) /// public gaxgrpc::CallSettings SetLabelsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ImagesClient.SetLabels and + /// ImagesClient.SetLabelsAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetLabelsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// ImagesClient.TestIamPermissions and ImagesClient.TestIamPermissionsAsync. @@ -359,7 +452,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteImageRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteImageRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -368,7 +461,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteImageRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteImageRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -377,9 +470,35 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteImageRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteImageRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified image. /// @@ -391,7 +510,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string image, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string image, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteImageRequest { Image = gax::GaxPreconditions.CheckNotNullOrEmpty(image, nameof(image)), @@ -409,7 +528,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string image, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string image, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteImageRequest { Image = gax::GaxPreconditions.CheckNotNullOrEmpty(image, nameof(image)), @@ -427,7 +546,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string image, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string image, st::CancellationToken cancellationToken) => DeleteAsync(project, image, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -438,7 +557,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Deprecate(DeprecateImageRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Deprecate(DeprecateImageRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -449,7 +568,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeprecateAsync(DeprecateImageRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeprecateAsync(DeprecateImageRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -460,9 +579,35 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeprecateAsync(DeprecateImageRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeprecateAsync(DeprecateImageRequest request, st::CancellationToken cancellationToken) => DeprecateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Deprecate. + public virtual lro::OperationsClient DeprecateOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Deprecate. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDeprecate(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeprecateOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// Deprecate. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeprecateAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeprecateOperationsClient, callSettings); + /// /// Sets the deprecation status of an image. /// @@ -479,7 +624,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Deprecate(string project, string image, DeprecationStatus deprecationStatusResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Deprecate(string project, string image, DeprecationStatus deprecationStatusResource, gaxgrpc::CallSettings callSettings = null) => Deprecate(new DeprecateImageRequest { DeprecationStatusResource = gax::GaxPreconditions.CheckNotNull(deprecationStatusResource, nameof(deprecationStatusResource)), @@ -503,7 +648,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeprecateAsync(string project, string image, DeprecationStatus deprecationStatusResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeprecateAsync(string project, string image, DeprecationStatus deprecationStatusResource, gaxgrpc::CallSettings callSettings = null) => DeprecateAsync(new DeprecateImageRequest { DeprecationStatusResource = gax::GaxPreconditions.CheckNotNull(deprecationStatusResource, nameof(deprecationStatusResource)), @@ -527,7 +672,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeprecateAsync(string project, string image, DeprecationStatus deprecationStatusResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeprecateAsync(string project, string image, DeprecationStatus deprecationStatusResource, st::CancellationToken cancellationToken) => DeprecateAsync(project, image, deprecationStatusResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -767,7 +912,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertImageRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertImageRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -776,7 +921,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertImageRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertImageRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -785,9 +930,35 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertImageRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertImageRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates an image in the specified project using the data included in the request. /// @@ -799,7 +970,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, Image imageResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, Image imageResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertImageRequest { ImageResource = gax::GaxPreconditions.CheckNotNull(imageResource, nameof(imageResource)), @@ -817,7 +988,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, Image imageResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, Image imageResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertImageRequest { ImageResource = gax::GaxPreconditions.CheckNotNull(imageResource, nameof(imageResource)), @@ -835,7 +1006,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, Image imageResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, Image imageResource, st::CancellationToken cancellationToken) => InsertAsync(project, imageResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -910,7 +1081,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchImageRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchImageRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -919,7 +1090,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchImageRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchImageRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -928,9 +1099,35 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchImageRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchImageRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Patches the specified image with the data included in the request. Only the following fields can be modified: family, description, deprecation status. /// @@ -945,7 +1142,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string image, Image imageResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string image, Image imageResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchImageRequest { Image = gax::GaxPreconditions.CheckNotNullOrEmpty(image, nameof(image)), @@ -967,7 +1164,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string image, Image imageResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string image, Image imageResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchImageRequest { Image = gax::GaxPreconditions.CheckNotNullOrEmpty(image, nameof(image)), @@ -989,7 +1186,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string image, Image imageResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string image, Image imageResource, st::CancellationToken cancellationToken) => PatchAsync(project, image, imageResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1086,7 +1283,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetLabels(SetLabelsImageRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetLabels(SetLabelsImageRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1095,7 +1292,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(SetLabelsImageRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetLabelsAsync(SetLabelsImageRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1104,9 +1301,35 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(SetLabelsImageRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetLabelsAsync(SetLabelsImageRequest request, st::CancellationToken cancellationToken) => SetLabelsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetLabels. + public virtual lro::OperationsClient SetLabelsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetLabels. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetLabels(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetLabelsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetLabels. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetLabelsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetLabelsOperationsClient, callSettings); + /// /// Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. /// @@ -1121,7 +1344,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetLabels(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetLabels(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetLabels(new SetLabelsImageRequest { GlobalSetLabelsRequestResource = gax::GaxPreconditions.CheckNotNull(globalSetLabelsRequestResource, nameof(globalSetLabelsRequestResource)), @@ -1143,7 +1366,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetLabelsAsync(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetLabelsAsync(new SetLabelsImageRequest { GlobalSetLabelsRequestResource = gax::GaxPreconditions.CheckNotNull(globalSetLabelsRequestResource, nameof(globalSetLabelsRequestResource)), @@ -1165,7 +1388,7 @@ internal static ImagesClient Create(grpccore::CallInvoker callInvoker, ImagesSet /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetLabelsAsync(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, st::CancellationToken cancellationToken) => SetLabelsAsync(project, resource, globalSetLabelsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1295,6 +1518,11 @@ public ImagesClientImpl(Images.ImagesClient grpcClient, ImagesSettings settings) GrpcClient = grpcClient; ImagesSettings effectiveSettings = settings ?? ImagesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + DeprecateOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeprecateOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.PatchOperationsSettings); + SetLabelsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.SetLabelsOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("image", request => request.Image); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -1382,16 +1610,22 @@ public ImagesClientImpl(Images.ImagesClient grpcClient, ImagesSettings settings) partial void Modify_TestIamPermissionsImageRequest(ref TestIamPermissionsImageRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified image. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteImageRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteImageRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteImageRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1400,12 +1634,18 @@ public override Operation Delete(DeleteImageRequest request, gaxgrpc::CallSettin /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteImageRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteImageRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteImageRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } + /// The long-running operations client for Deprecate. + public override lro::OperationsClient DeprecateOperationsClient { get; } + /// /// Sets the deprecation status of an image. /// @@ -1414,10 +1654,13 @@ public override Operation Delete(DeleteImageRequest request, gaxgrpc::CallSettin /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Deprecate(DeprecateImageRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Deprecate(DeprecateImageRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeprecateImageRequest(ref request, ref callSettings); - return _callDeprecate.Sync(request, callSettings); + Operation response = _callDeprecate.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeprecateOperationsClient); } /// @@ -1428,10 +1671,13 @@ public override Operation Deprecate(DeprecateImageRequest request, gaxgrpc::Call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeprecateAsync(DeprecateImageRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeprecateAsync(DeprecateImageRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeprecateImageRequest(ref request, ref callSettings); - return _callDeprecate.Async(request, callSettings); + Operation response = await _callDeprecate.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeprecateOperationsClient); } /// @@ -1506,16 +1752,22 @@ public override Policy GetIamPolicy(GetIamPolicyImageRequest request, gaxgrpc::C return _callGetIamPolicy.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates an image in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertImageRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertImageRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertImageRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1524,10 +1776,13 @@ public override Operation Insert(InsertImageRequest request, gaxgrpc::CallSettin /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertImageRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertImageRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertImageRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1554,16 +1809,22 @@ public override Operation Insert(InsertImageRequest request, gaxgrpc::CallSettin return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Patches the specified image with the data included in the request. Only the following fields can be modified: family, description, deprecation status. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchImageRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchImageRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchImageRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1572,10 +1833,13 @@ public override Operation Patch(PatchImageRequest request, gaxgrpc::CallSettings /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchImageRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchImageRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchImageRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1602,16 +1866,22 @@ public override Policy SetIamPolicy(SetIamPolicyImageRequest request, gaxgrpc::C return _callSetIamPolicy.Async(request, callSettings); } + /// The long-running operations client for SetLabels. + public override lro::OperationsClient SetLabelsOperationsClient { get; } + /// /// Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetLabels(SetLabelsImageRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetLabels(SetLabelsImageRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetLabelsImageRequest(ref request, ref callSettings); - return _callSetLabels.Sync(request, callSettings); + Operation response = _callSetLabels.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetLabelsOperationsClient); } /// @@ -1620,10 +1890,13 @@ public override Operation SetLabels(SetLabelsImageRequest request, gaxgrpc::Call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetLabelsAsync(SetLabelsImageRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetLabelsAsync(SetLabelsImageRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetLabelsImageRequest(ref request, ref callSettings); - return _callSetLabels.Async(request, callSettings); + Operation response = await _callSetLabels.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetLabelsOperationsClient); } /// @@ -1668,4 +1941,18 @@ public partial class ImageList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class Images + { + public partial class ImagesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InstanceGroupManagersClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InstanceGroupManagersClient.g.cs index 2c392ad77c8f..73c306aa95a4 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InstanceGroupManagersClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InstanceGroupManagersClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -47,25 +48,39 @@ private InstanceGroupManagersSettings(InstanceGroupManagersSettings existing) : { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AbandonInstancesSettings = existing.AbandonInstancesSettings; + AbandonInstancesOperationsSettings = existing.AbandonInstancesOperationsSettings.Clone(); AggregatedListSettings = existing.AggregatedListSettings; ApplyUpdatesToInstancesSettings = existing.ApplyUpdatesToInstancesSettings; + ApplyUpdatesToInstancesOperationsSettings = existing.ApplyUpdatesToInstancesOperationsSettings.Clone(); CreateInstancesSettings = existing.CreateInstancesSettings; + CreateInstancesOperationsSettings = existing.CreateInstancesOperationsSettings.Clone(); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); DeleteInstancesSettings = existing.DeleteInstancesSettings; + DeleteInstancesOperationsSettings = existing.DeleteInstancesOperationsSettings.Clone(); DeletePerInstanceConfigsSettings = existing.DeletePerInstanceConfigsSettings; + DeletePerInstanceConfigsOperationsSettings = existing.DeletePerInstanceConfigsOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; ListErrorsSettings = existing.ListErrorsSettings; ListManagedInstancesSettings = existing.ListManagedInstancesSettings; ListPerInstanceConfigsSettings = existing.ListPerInstanceConfigsSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); PatchPerInstanceConfigsSettings = existing.PatchPerInstanceConfigsSettings; + PatchPerInstanceConfigsOperationsSettings = existing.PatchPerInstanceConfigsOperationsSettings.Clone(); RecreateInstancesSettings = existing.RecreateInstancesSettings; + RecreateInstancesOperationsSettings = existing.RecreateInstancesOperationsSettings.Clone(); ResizeSettings = existing.ResizeSettings; + ResizeOperationsSettings = existing.ResizeOperationsSettings.Clone(); SetInstanceTemplateSettings = existing.SetInstanceTemplateSettings; + SetInstanceTemplateOperationsSettings = existing.SetInstanceTemplateOperationsSettings.Clone(); SetTargetPoolsSettings = existing.SetTargetPoolsSettings; + SetTargetPoolsOperationsSettings = existing.SetTargetPoolsOperationsSettings.Clone(); UpdatePerInstanceConfigsSettings = existing.UpdatePerInstanceConfigsSettings; + UpdatePerInstanceConfigsOperationsSettings = existing.UpdatePerInstanceConfigsOperationsSettings.Clone(); OnCopy(existing); } @@ -84,6 +99,24 @@ private InstanceGroupManagersSettings(InstanceGroupManagersSettings existing) : /// public gaxgrpc::CallSettings AbandonInstancesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstanceGroupManagersClient.AbandonInstances and + /// InstanceGroupManagersClient.AbandonInstancesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings AbandonInstancesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstanceGroupManagersClient.AggregatedList and InstanceGroupManagersClient.AggregatedListAsync @@ -110,6 +143,24 @@ private InstanceGroupManagersSettings(InstanceGroupManagersSettings existing) : /// public gaxgrpc::CallSettings ApplyUpdatesToInstancesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstanceGroupManagersClient.ApplyUpdatesToInstances and + /// InstanceGroupManagersClient.ApplyUpdatesToInstancesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings ApplyUpdatesToInstancesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstanceGroupManagersClient.CreateInstances and InstanceGroupManagersClient.CreateInstancesAsync @@ -123,6 +174,24 @@ private InstanceGroupManagersSettings(InstanceGroupManagersSettings existing) : /// public gaxgrpc::CallSettings CreateInstancesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstanceGroupManagersClient.CreateInstances and + /// InstanceGroupManagersClient.CreateInstancesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings CreateInstancesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstanceGroupManagersClient.Delete and InstanceGroupManagersClient.DeleteAsync. @@ -135,6 +204,24 @@ private InstanceGroupManagersSettings(InstanceGroupManagersSettings existing) : /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstanceGroupManagersClient.Delete and + /// InstanceGroupManagersClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstanceGroupManagersClient.DeleteInstances and InstanceGroupManagersClient.DeleteInstancesAsync @@ -148,6 +235,24 @@ private InstanceGroupManagersSettings(InstanceGroupManagersSettings existing) : /// public gaxgrpc::CallSettings DeleteInstancesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstanceGroupManagersClient.DeleteInstances and + /// InstanceGroupManagersClient.DeleteInstancesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteInstancesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstanceGroupManagersClient.DeletePerInstanceConfigs and @@ -161,6 +266,24 @@ private InstanceGroupManagersSettings(InstanceGroupManagersSettings existing) : /// public gaxgrpc::CallSettings DeletePerInstanceConfigsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstanceGroupManagersClient.DeletePerInstanceConfigs and + /// InstanceGroupManagersClient.DeletePerInstanceConfigsAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeletePerInstanceConfigsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstanceGroupManagersClient.Get and InstanceGroupManagersClient.GetAsync. @@ -185,6 +308,24 @@ private InstanceGroupManagersSettings(InstanceGroupManagersSettings existing) : /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstanceGroupManagersClient.Insert and + /// InstanceGroupManagersClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstanceGroupManagersClient.List and InstanceGroupManagersClient.ListAsync. @@ -247,6 +388,24 @@ private InstanceGroupManagersSettings(InstanceGroupManagersSettings existing) : /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstanceGroupManagersClient.Patch and + /// InstanceGroupManagersClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstanceGroupManagersClient.PatchPerInstanceConfigs and @@ -260,6 +419,24 @@ private InstanceGroupManagersSettings(InstanceGroupManagersSettings existing) : /// public gaxgrpc::CallSettings PatchPerInstanceConfigsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstanceGroupManagersClient.PatchPerInstanceConfigs and + /// InstanceGroupManagersClient.PatchPerInstanceConfigsAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchPerInstanceConfigsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstanceGroupManagersClient.RecreateInstances and @@ -273,6 +450,24 @@ private InstanceGroupManagersSettings(InstanceGroupManagersSettings existing) : /// public gaxgrpc::CallSettings RecreateInstancesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstanceGroupManagersClient.RecreateInstances and + /// InstanceGroupManagersClient.RecreateInstancesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings RecreateInstancesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstanceGroupManagersClient.Resize and InstanceGroupManagersClient.ResizeAsync. @@ -285,6 +480,24 @@ private InstanceGroupManagersSettings(InstanceGroupManagersSettings existing) : /// public gaxgrpc::CallSettings ResizeSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstanceGroupManagersClient.Resize and + /// InstanceGroupManagersClient.ResizeAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings ResizeOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstanceGroupManagersClient.SetInstanceTemplate and @@ -298,6 +511,24 @@ private InstanceGroupManagersSettings(InstanceGroupManagersSettings existing) : /// public gaxgrpc::CallSettings SetInstanceTemplateSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstanceGroupManagersClient.SetInstanceTemplate and + /// InstanceGroupManagersClient.SetInstanceTemplateAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetInstanceTemplateOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstanceGroupManagersClient.SetTargetPools and InstanceGroupManagersClient.SetTargetPoolsAsync @@ -311,6 +542,24 @@ private InstanceGroupManagersSettings(InstanceGroupManagersSettings existing) : /// public gaxgrpc::CallSettings SetTargetPoolsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstanceGroupManagersClient.SetTargetPools and + /// InstanceGroupManagersClient.SetTargetPoolsAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetTargetPoolsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstanceGroupManagersClient.UpdatePerInstanceConfigs and @@ -324,6 +573,24 @@ private InstanceGroupManagersSettings(InstanceGroupManagersSettings existing) : /// public gaxgrpc::CallSettings UpdatePerInstanceConfigsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstanceGroupManagersClient.UpdatePerInstanceConfigs and + /// InstanceGroupManagersClient.UpdatePerInstanceConfigsAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings UpdatePerInstanceConfigsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public InstanceGroupManagersSettings Clone() => new InstanceGroupManagersSettings(this); @@ -500,7 +767,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AbandonInstances(AbandonInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AbandonInstances(AbandonInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -513,7 +780,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AbandonInstancesAsync(AbandonInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AbandonInstancesAsync(AbandonInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -526,9 +793,35 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AbandonInstancesAsync(AbandonInstancesInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> AbandonInstancesAsync(AbandonInstancesInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => AbandonInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for AbandonInstances. + public virtual lro::OperationsClient AbandonInstancesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of AbandonInstances. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceAbandonInstances(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AbandonInstancesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// AbandonInstances. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceAbandonInstancesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AbandonInstancesOperationsClient, callSettings); + /// /// Flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. /// @@ -550,7 +843,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AbandonInstances(string project, string zone, string instanceGroupManager, InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AbandonInstances(string project, string zone, string instanceGroupManager, InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => AbandonInstances(new AbandonInstancesInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -580,7 +873,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AbandonInstancesAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AbandonInstancesAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => AbandonInstancesAsync(new AbandonInstancesInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -610,7 +903,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AbandonInstancesAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> AbandonInstancesAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource, st::CancellationToken cancellationToken) => AbandonInstancesAsync(project, zone, instanceGroupManager, instanceGroupManagersAbandonInstancesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -689,7 +982,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation ApplyUpdatesToInstances(ApplyUpdatesToInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation ApplyUpdatesToInstances(ApplyUpdatesToInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -698,7 +991,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task ApplyUpdatesToInstancesAsync(ApplyUpdatesToInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> ApplyUpdatesToInstancesAsync(ApplyUpdatesToInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -707,9 +1000,36 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task ApplyUpdatesToInstancesAsync(ApplyUpdatesToInstancesInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> ApplyUpdatesToInstancesAsync(ApplyUpdatesToInstancesInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => ApplyUpdatesToInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for ApplyUpdatesToInstances. + public virtual lro::OperationsClient ApplyUpdatesToInstancesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of + /// ApplyUpdatesToInstances. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceApplyUpdatesToInstances(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), ApplyUpdatesToInstancesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// ApplyUpdatesToInstances. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceApplyUpdatesToInstancesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), ApplyUpdatesToInstancesOperationsClient, callSettings); + /// /// Applies changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions. /// @@ -727,7 +1047,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation ApplyUpdatesToInstances(string project, string zone, string instanceGroupManager, InstanceGroupManagersApplyUpdatesRequest instanceGroupManagersApplyUpdatesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation ApplyUpdatesToInstances(string project, string zone, string instanceGroupManager, InstanceGroupManagersApplyUpdatesRequest instanceGroupManagersApplyUpdatesRequestResource, gaxgrpc::CallSettings callSettings = null) => ApplyUpdatesToInstances(new ApplyUpdatesToInstancesInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -753,7 +1073,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task ApplyUpdatesToInstancesAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersApplyUpdatesRequest instanceGroupManagersApplyUpdatesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> ApplyUpdatesToInstancesAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersApplyUpdatesRequest instanceGroupManagersApplyUpdatesRequestResource, gaxgrpc::CallSettings callSettings = null) => ApplyUpdatesToInstancesAsync(new ApplyUpdatesToInstancesInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -779,7 +1099,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task ApplyUpdatesToInstancesAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersApplyUpdatesRequest instanceGroupManagersApplyUpdatesRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> ApplyUpdatesToInstancesAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersApplyUpdatesRequest instanceGroupManagersApplyUpdatesRequestResource, st::CancellationToken cancellationToken) => ApplyUpdatesToInstancesAsync(project, zone, instanceGroupManager, instanceGroupManagersApplyUpdatesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -788,7 +1108,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation CreateInstances(CreateInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation CreateInstances(CreateInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -797,7 +1117,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task CreateInstancesAsync(CreateInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> CreateInstancesAsync(CreateInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -806,9 +1126,35 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task CreateInstancesAsync(CreateInstancesInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> CreateInstancesAsync(CreateInstancesInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => CreateInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for CreateInstances. + public virtual lro::OperationsClient CreateInstancesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of CreateInstances. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceCreateInstances(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), CreateInstancesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// CreateInstances. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceCreateInstancesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), CreateInstancesOperationsClient, callSettings); + /// /// Creates instances with per-instance configs in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. /// @@ -826,7 +1172,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation CreateInstances(string project, string zone, string instanceGroupManager, InstanceGroupManagersCreateInstancesRequest instanceGroupManagersCreateInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation CreateInstances(string project, string zone, string instanceGroupManager, InstanceGroupManagersCreateInstancesRequest instanceGroupManagersCreateInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => CreateInstances(new CreateInstancesInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -852,7 +1198,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task CreateInstancesAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersCreateInstancesRequest instanceGroupManagersCreateInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> CreateInstancesAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersCreateInstancesRequest instanceGroupManagersCreateInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => CreateInstancesAsync(new CreateInstancesInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -878,7 +1224,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task CreateInstancesAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersCreateInstancesRequest instanceGroupManagersCreateInstancesRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> CreateInstancesAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersCreateInstancesRequest instanceGroupManagersCreateInstancesRequestResource, st::CancellationToken cancellationToken) => CreateInstancesAsync(project, zone, instanceGroupManager, instanceGroupManagersCreateInstancesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -887,7 +1233,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -896,7 +1242,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -905,9 +1251,35 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information. /// @@ -922,7 +1294,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string zone, string instanceGroupManager, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string zone, string instanceGroupManager, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -944,7 +1316,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string zone, string instanceGroupManager, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string zone, string instanceGroupManager, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -966,7 +1338,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string zone, string instanceGroupManager, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string zone, string instanceGroupManager, st::CancellationToken cancellationToken) => DeleteAsync(project, zone, instanceGroupManager, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -979,7 +1351,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DeleteInstances(DeleteInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DeleteInstances(DeleteInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -992,7 +1364,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteInstancesAsync(DeleteInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteInstancesAsync(DeleteInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1005,9 +1377,35 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteInstancesAsync(DeleteInstancesInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteInstancesAsync(DeleteInstancesInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => DeleteInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for DeleteInstances. + public virtual lro::OperationsClient DeleteInstancesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of DeleteInstances. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDeleteInstances(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteInstancesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// DeleteInstances. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteInstancesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteInstancesOperationsClient, callSettings); + /// /// Flags the specified instances in the managed instance group for immediate deletion. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method. /// @@ -1029,7 +1427,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DeleteInstances(string project, string zone, string instanceGroupManager, InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DeleteInstances(string project, string zone, string instanceGroupManager, InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => DeleteInstances(new DeleteInstancesInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -1059,7 +1457,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteInstancesAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteInstancesAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => DeleteInstancesAsync(new DeleteInstancesInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -1089,7 +1487,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteInstancesAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteInstancesAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource, st::CancellationToken cancellationToken) => DeleteInstancesAsync(project, zone, instanceGroupManager, instanceGroupManagersDeleteInstancesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1098,7 +1496,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DeletePerInstanceConfigs(DeletePerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DeletePerInstanceConfigs(DeletePerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1107,7 +1505,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeletePerInstanceConfigsAsync(DeletePerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeletePerInstanceConfigsAsync(DeletePerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1116,9 +1514,36 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeletePerInstanceConfigsAsync(DeletePerInstanceConfigsInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeletePerInstanceConfigsAsync(DeletePerInstanceConfigsInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => DeletePerInstanceConfigsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for DeletePerInstanceConfigs. + public virtual lro::OperationsClient DeletePerInstanceConfigsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of + /// DeletePerInstanceConfigs. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDeletePerInstanceConfigs(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeletePerInstanceConfigsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// DeletePerInstanceConfigs. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeletePerInstanceConfigsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeletePerInstanceConfigsOperationsClient, callSettings); + /// /// Deletes selected per-instance configs for the managed instance group. /// @@ -1136,7 +1561,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DeletePerInstanceConfigs(string project, string zone, string instanceGroupManager, InstanceGroupManagersDeletePerInstanceConfigsReq instanceGroupManagersDeletePerInstanceConfigsReqResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DeletePerInstanceConfigs(string project, string zone, string instanceGroupManager, InstanceGroupManagersDeletePerInstanceConfigsReq instanceGroupManagersDeletePerInstanceConfigsReqResource, gaxgrpc::CallSettings callSettings = null) => DeletePerInstanceConfigs(new DeletePerInstanceConfigsInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -1162,7 +1587,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeletePerInstanceConfigsAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersDeletePerInstanceConfigsReq instanceGroupManagersDeletePerInstanceConfigsReqResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeletePerInstanceConfigsAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersDeletePerInstanceConfigsReq instanceGroupManagersDeletePerInstanceConfigsReqResource, gaxgrpc::CallSettings callSettings = null) => DeletePerInstanceConfigsAsync(new DeletePerInstanceConfigsInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -1188,7 +1613,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeletePerInstanceConfigsAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersDeletePerInstanceConfigsReq instanceGroupManagersDeletePerInstanceConfigsReqResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeletePerInstanceConfigsAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersDeletePerInstanceConfigsReq instanceGroupManagersDeletePerInstanceConfigsReqResource, st::CancellationToken cancellationToken) => DeletePerInstanceConfigsAsync(project, zone, instanceGroupManager, instanceGroupManagersDeletePerInstanceConfigsReqResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1287,7 +1712,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1298,7 +1723,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1309,9 +1734,35 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. /// @@ -1328,7 +1779,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string zone, InstanceGroupManager instanceGroupManagerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string zone, InstanceGroupManager instanceGroupManagerResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertInstanceGroupManagerRequest { InstanceGroupManagerResource = gax::GaxPreconditions.CheckNotNull(instanceGroupManagerResource, nameof(instanceGroupManagerResource)), @@ -1352,7 +1803,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string zone, InstanceGroupManager instanceGroupManagerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string zone, InstanceGroupManager instanceGroupManagerResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertInstanceGroupManagerRequest { InstanceGroupManagerResource = gax::GaxPreconditions.CheckNotNull(instanceGroupManagerResource, nameof(instanceGroupManagerResource)), @@ -1376,7 +1827,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string zone, InstanceGroupManager instanceGroupManagerResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string zone, InstanceGroupManager instanceGroupManagerResource, st::CancellationToken cancellationToken) => InsertAsync(project, zone, instanceGroupManagerResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1705,7 +2156,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1714,7 +2165,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1723,9 +2174,35 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// @@ -1743,7 +2220,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string zone, string instanceGroupManager, InstanceGroupManager instanceGroupManagerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string zone, string instanceGroupManager, InstanceGroupManager instanceGroupManagerResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -1769,7 +2246,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string zone, string instanceGroupManager, InstanceGroupManager instanceGroupManagerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string zone, string instanceGroupManager, InstanceGroupManager instanceGroupManagerResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -1795,7 +2272,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string zone, string instanceGroupManager, InstanceGroupManager instanceGroupManagerResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string zone, string instanceGroupManager, InstanceGroupManager instanceGroupManagerResource, st::CancellationToken cancellationToken) => PatchAsync(project, zone, instanceGroupManager, instanceGroupManagerResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1804,7 +2281,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation PatchPerInstanceConfigs(PatchPerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation PatchPerInstanceConfigs(PatchPerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1813,7 +2290,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchPerInstanceConfigsAsync(PatchPerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchPerInstanceConfigsAsync(PatchPerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1822,9 +2299,36 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchPerInstanceConfigsAsync(PatchPerInstanceConfigsInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchPerInstanceConfigsAsync(PatchPerInstanceConfigsInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => PatchPerInstanceConfigsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for PatchPerInstanceConfigs. + public virtual lro::OperationsClient PatchPerInstanceConfigsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of + /// PatchPerInstanceConfigs. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatchPerInstanceConfigs(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchPerInstanceConfigsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// PatchPerInstanceConfigs. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchPerInstanceConfigsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchPerInstanceConfigsOperationsClient, callSettings); + /// /// Inserts or patches per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. /// @@ -1842,7 +2346,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation PatchPerInstanceConfigs(string project, string zone, string instanceGroupManager, InstanceGroupManagersPatchPerInstanceConfigsReq instanceGroupManagersPatchPerInstanceConfigsReqResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation PatchPerInstanceConfigs(string project, string zone, string instanceGroupManager, InstanceGroupManagersPatchPerInstanceConfigsReq instanceGroupManagersPatchPerInstanceConfigsReqResource, gaxgrpc::CallSettings callSettings = null) => PatchPerInstanceConfigs(new PatchPerInstanceConfigsInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -1868,7 +2372,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchPerInstanceConfigsAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersPatchPerInstanceConfigsReq instanceGroupManagersPatchPerInstanceConfigsReqResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchPerInstanceConfigsAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersPatchPerInstanceConfigsReq instanceGroupManagersPatchPerInstanceConfigsReqResource, gaxgrpc::CallSettings callSettings = null) => PatchPerInstanceConfigsAsync(new PatchPerInstanceConfigsInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -1894,7 +2398,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchPerInstanceConfigsAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersPatchPerInstanceConfigsReq instanceGroupManagersPatchPerInstanceConfigsReqResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchPerInstanceConfigsAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersPatchPerInstanceConfigsReq instanceGroupManagersPatchPerInstanceConfigsReqResource, st::CancellationToken cancellationToken) => PatchPerInstanceConfigsAsync(project, zone, instanceGroupManager, instanceGroupManagersPatchPerInstanceConfigsReqResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1907,7 +2411,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RecreateInstances(RecreateInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RecreateInstances(RecreateInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1920,7 +2424,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RecreateInstancesAsync(RecreateInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RecreateInstancesAsync(RecreateInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1933,9 +2437,36 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RecreateInstancesAsync(RecreateInstancesInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> RecreateInstancesAsync(RecreateInstancesInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => RecreateInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for RecreateInstances. + public virtual lro::OperationsClient RecreateInstancesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of RecreateInstances + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceRecreateInstances(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RecreateInstancesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// RecreateInstances. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceRecreateInstancesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RecreateInstancesOperationsClient, callSettings); + /// /// Flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group's current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking its currentAction field; for more information, see Checking the status of managed instances. /// @@ -1957,7 +2488,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RecreateInstances(string project, string zone, string instanceGroupManager, InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RecreateInstances(string project, string zone, string instanceGroupManager, InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => RecreateInstances(new RecreateInstancesInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -1987,7 +2518,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RecreateInstancesAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RecreateInstancesAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => RecreateInstancesAsync(new RecreateInstancesInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -2017,7 +2548,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RecreateInstancesAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> RecreateInstancesAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource, st::CancellationToken cancellationToken) => RecreateInstancesAsync(project, zone, instanceGroupManager, instanceGroupManagersRecreateInstancesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -2034,7 +2565,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Resize(ResizeInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Resize(ResizeInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2051,7 +2582,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task ResizeAsync(ResizeInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> ResizeAsync(ResizeInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2068,9 +2599,35 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task ResizeAsync(ResizeInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> ResizeAsync(ResizeInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => ResizeAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Resize. + public virtual lro::OperationsClient ResizeOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Resize. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceResize(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), ResizeOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Resize + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceResizeAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), ResizeOperationsClient, callSettings); + /// /// Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. /// @@ -2096,7 +2653,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Resize(string project, string zone, string instanceGroupManager, int size, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Resize(string project, string zone, string instanceGroupManager, int size, gaxgrpc::CallSettings callSettings = null) => Resize(new ResizeInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -2130,7 +2687,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task ResizeAsync(string project, string zone, string instanceGroupManager, int size, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> ResizeAsync(string project, string zone, string instanceGroupManager, int size, gaxgrpc::CallSettings callSettings = null) => ResizeAsync(new ResizeInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -2164,7 +2721,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task ResizeAsync(string project, string zone, string instanceGroupManager, int size, st::CancellationToken cancellationToken) => + public virtual stt::Task> ResizeAsync(string project, string zone, string instanceGroupManager, int size, st::CancellationToken cancellationToken) => ResizeAsync(project, zone, instanceGroupManager, size, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -2173,7 +2730,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetInstanceTemplate(SetInstanceTemplateInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetInstanceTemplate(SetInstanceTemplateInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2182,7 +2739,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetInstanceTemplateAsync(SetInstanceTemplateInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetInstanceTemplateAsync(SetInstanceTemplateInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2191,9 +2748,36 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetInstanceTemplateAsync(SetInstanceTemplateInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetInstanceTemplateAsync(SetInstanceTemplateInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => SetInstanceTemplateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetInstanceTemplate. + public virtual lro::OperationsClient SetInstanceTemplateOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetInstanceTemplate + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetInstanceTemplate(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetInstanceTemplateOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetInstanceTemplate. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetInstanceTemplateAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetInstanceTemplateOperationsClient, callSettings); + /// /// Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE. /// @@ -2211,7 +2795,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetInstanceTemplate(string project, string zone, string instanceGroupManager, InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetInstanceTemplate(string project, string zone, string instanceGroupManager, InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource, gaxgrpc::CallSettings callSettings = null) => SetInstanceTemplate(new SetInstanceTemplateInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -2237,7 +2821,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetInstanceTemplateAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetInstanceTemplateAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource, gaxgrpc::CallSettings callSettings = null) => SetInstanceTemplateAsync(new SetInstanceTemplateInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -2263,7 +2847,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetInstanceTemplateAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetInstanceTemplateAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource, st::CancellationToken cancellationToken) => SetInstanceTemplateAsync(project, zone, instanceGroupManager, instanceGroupManagersSetInstanceTemplateRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -2272,7 +2856,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetTargetPools(SetTargetPoolsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetTargetPools(SetTargetPoolsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2281,7 +2865,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetTargetPoolsAsync(SetTargetPoolsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetTargetPoolsAsync(SetTargetPoolsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2290,9 +2874,35 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetTargetPoolsAsync(SetTargetPoolsInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetTargetPoolsAsync(SetTargetPoolsInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => SetTargetPoolsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetTargetPools. + public virtual lro::OperationsClient SetTargetPoolsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetTargetPools. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetTargetPools(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetTargetPoolsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetTargetPools. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetTargetPoolsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetTargetPoolsOperationsClient, callSettings); + /// /// Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group. /// @@ -2310,7 +2920,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetTargetPools(string project, string zone, string instanceGroupManager, InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetTargetPools(string project, string zone, string instanceGroupManager, InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetTargetPools(new SetTargetPoolsInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -2336,7 +2946,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetTargetPoolsAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetTargetPoolsAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetTargetPoolsAsync(new SetTargetPoolsInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -2362,7 +2972,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetTargetPoolsAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetTargetPoolsAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource, st::CancellationToken cancellationToken) => SetTargetPoolsAsync(project, zone, instanceGroupManager, instanceGroupManagersSetTargetPoolsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -2371,7 +2981,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation UpdatePerInstanceConfigs(UpdatePerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation UpdatePerInstanceConfigs(UpdatePerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2380,7 +2990,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdatePerInstanceConfigsAsync(UpdatePerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdatePerInstanceConfigsAsync(UpdatePerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2389,9 +2999,36 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdatePerInstanceConfigsAsync(UpdatePerInstanceConfigsInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdatePerInstanceConfigsAsync(UpdatePerInstanceConfigsInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => UpdatePerInstanceConfigsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for UpdatePerInstanceConfigs. + public virtual lro::OperationsClient UpdatePerInstanceConfigsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of + /// UpdatePerInstanceConfigs. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceUpdatePerInstanceConfigs(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdatePerInstanceConfigsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// UpdatePerInstanceConfigs. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceUpdatePerInstanceConfigsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdatePerInstanceConfigsOperationsClient, callSettings); + /// /// Inserts or updates per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. /// @@ -2409,7 +3046,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation UpdatePerInstanceConfigs(string project, string zone, string instanceGroupManager, InstanceGroupManagersUpdatePerInstanceConfigsReq instanceGroupManagersUpdatePerInstanceConfigsReqResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation UpdatePerInstanceConfigs(string project, string zone, string instanceGroupManager, InstanceGroupManagersUpdatePerInstanceConfigsReq instanceGroupManagersUpdatePerInstanceConfigsReqResource, gaxgrpc::CallSettings callSettings = null) => UpdatePerInstanceConfigs(new UpdatePerInstanceConfigsInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -2435,7 +3072,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdatePerInstanceConfigsAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersUpdatePerInstanceConfigsReq instanceGroupManagersUpdatePerInstanceConfigsReqResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdatePerInstanceConfigsAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersUpdatePerInstanceConfigsReq instanceGroupManagersUpdatePerInstanceConfigsReqResource, gaxgrpc::CallSettings callSettings = null) => UpdatePerInstanceConfigsAsync(new UpdatePerInstanceConfigsInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -2461,7 +3098,7 @@ internal static InstanceGroupManagersClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdatePerInstanceConfigsAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersUpdatePerInstanceConfigsReq instanceGroupManagersUpdatePerInstanceConfigsReqResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdatePerInstanceConfigsAsync(string project, string zone, string instanceGroupManager, InstanceGroupManagersUpdatePerInstanceConfigsReq instanceGroupManagersUpdatePerInstanceConfigsReqResource, st::CancellationToken cancellationToken) => UpdatePerInstanceConfigsAsync(project, zone, instanceGroupManager, instanceGroupManagersUpdatePerInstanceConfigsReqResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -2522,6 +3159,20 @@ public InstanceGroupManagersClientImpl(InstanceGroupManagers.InstanceGroupManage GrpcClient = grpcClient; InstanceGroupManagersSettings effectiveSettings = settings ?? InstanceGroupManagersSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + AbandonInstancesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.AbandonInstancesOperationsSettings); + ApplyUpdatesToInstancesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.ApplyUpdatesToInstancesOperationsSettings); + CreateInstancesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.CreateInstancesOperationsSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.DeleteOperationsSettings); + DeleteInstancesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.DeleteInstancesOperationsSettings); + DeletePerInstanceConfigsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.DeletePerInstanceConfigsOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.PatchOperationsSettings); + PatchPerInstanceConfigsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.PatchPerInstanceConfigsOperationsSettings); + RecreateInstancesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.RecreateInstancesOperationsSettings); + ResizeOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.ResizeOperationsSettings); + SetInstanceTemplateOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.SetInstanceTemplateOperationsSettings); + SetTargetPoolsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.SetTargetPoolsOperationsSettings); + UpdatePerInstanceConfigsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.UpdatePerInstanceConfigsOperationsSettings); _callAbandonInstances = clientHelper.BuildApiCall(grpcClient.AbandonInstancesAsync, grpcClient.AbandonInstances, effectiveSettings.AbandonInstancesSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("zone", request => request.Zone).WithGoogleRequestParam("instance_group_manager", request => request.InstanceGroupManager); Modify_ApiCall(ref _callAbandonInstances); Modify_AbandonInstancesApiCall(ref _callAbandonInstances); @@ -2672,6 +3323,9 @@ public InstanceGroupManagersClientImpl(InstanceGroupManagers.InstanceGroupManage partial void Modify_UpdatePerInstanceConfigsInstanceGroupManagerRequest(ref UpdatePerInstanceConfigsInstanceGroupManagerRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for AbandonInstances. + public override lro::OperationsClient AbandonInstancesOperationsClient { get; } + /// /// Flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. /// @@ -2682,10 +3336,13 @@ public InstanceGroupManagersClientImpl(InstanceGroupManagers.InstanceGroupManage /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation AbandonInstances(AbandonInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation AbandonInstances(AbandonInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AbandonInstancesInstanceGroupManagerRequest(ref request, ref callSettings); - return _callAbandonInstances.Sync(request, callSettings); + Operation response = _callAbandonInstances.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AbandonInstancesOperationsClient); } /// @@ -2698,10 +3355,13 @@ public override Operation AbandonInstances(AbandonInstancesInstanceGroupManagerR /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task AbandonInstancesAsync(AbandonInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> AbandonInstancesAsync(AbandonInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AbandonInstancesInstanceGroupManagerRequest(ref request, ref callSettings); - return _callAbandonInstances.Async(request, callSettings); + Operation response = await _callAbandonInstances.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AbandonInstancesOperationsClient); } /// @@ -2730,16 +3390,22 @@ public override Operation AbandonInstances(AbandonInstancesInstanceGroupManagerR return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for ApplyUpdatesToInstances. + public override lro::OperationsClient ApplyUpdatesToInstancesOperationsClient { get; } + /// /// Applies changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation ApplyUpdatesToInstances(ApplyUpdatesToInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation ApplyUpdatesToInstances(ApplyUpdatesToInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ApplyUpdatesToInstancesInstanceGroupManagerRequest(ref request, ref callSettings); - return _callApplyUpdatesToInstances.Sync(request, callSettings); + Operation response = _callApplyUpdatesToInstances.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), ApplyUpdatesToInstancesOperationsClient); } /// @@ -2748,22 +3414,31 @@ public override Operation ApplyUpdatesToInstances(ApplyUpdatesToInstancesInstanc /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task ApplyUpdatesToInstancesAsync(ApplyUpdatesToInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> ApplyUpdatesToInstancesAsync(ApplyUpdatesToInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ApplyUpdatesToInstancesInstanceGroupManagerRequest(ref request, ref callSettings); - return _callApplyUpdatesToInstances.Async(request, callSettings); + Operation response = await _callApplyUpdatesToInstances.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), ApplyUpdatesToInstancesOperationsClient); } + /// The long-running operations client for CreateInstances. + public override lro::OperationsClient CreateInstancesOperationsClient { get; } + /// /// Creates instances with per-instance configs in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation CreateInstances(CreateInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation CreateInstances(CreateInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_CreateInstancesInstanceGroupManagerRequest(ref request, ref callSettings); - return _callCreateInstances.Sync(request, callSettings); + Operation response = _callCreateInstances.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), CreateInstancesOperationsClient); } /// @@ -2772,22 +3447,31 @@ public override Operation CreateInstances(CreateInstancesInstanceGroupManagerReq /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task CreateInstancesAsync(CreateInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> CreateInstancesAsync(CreateInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_CreateInstancesInstanceGroupManagerRequest(ref request, ref callSettings); - return _callCreateInstances.Async(request, callSettings); + Operation response = await _callCreateInstances.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), CreateInstancesOperationsClient); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteInstanceGroupManagerRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -2796,12 +3480,18 @@ public override Operation Delete(DeleteInstanceGroupManagerRequest request, gaxg /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteInstanceGroupManagerRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } + /// The long-running operations client for DeleteInstances. + public override lro::OperationsClient DeleteInstancesOperationsClient { get; } + /// /// Flags the specified instances in the managed instance group for immediate deletion. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method. /// @@ -2812,10 +3502,13 @@ public override Operation Delete(DeleteInstanceGroupManagerRequest request, gaxg /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation DeleteInstances(DeleteInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation DeleteInstances(DeleteInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteInstancesInstanceGroupManagerRequest(ref request, ref callSettings); - return _callDeleteInstances.Sync(request, callSettings); + Operation response = _callDeleteInstances.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteInstancesOperationsClient); } /// @@ -2828,22 +3521,31 @@ public override Operation DeleteInstances(DeleteInstancesInstanceGroupManagerReq /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteInstancesAsync(DeleteInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteInstancesAsync(DeleteInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteInstancesInstanceGroupManagerRequest(ref request, ref callSettings); - return _callDeleteInstances.Async(request, callSettings); + Operation response = await _callDeleteInstances.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteInstancesOperationsClient); } + /// The long-running operations client for DeletePerInstanceConfigs. + public override lro::OperationsClient DeletePerInstanceConfigsOperationsClient { get; } + /// /// Deletes selected per-instance configs for the managed instance group. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation DeletePerInstanceConfigs(DeletePerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation DeletePerInstanceConfigs(DeletePerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeletePerInstanceConfigsInstanceGroupManagerRequest(ref request, ref callSettings); - return _callDeletePerInstanceConfigs.Sync(request, callSettings); + Operation response = _callDeletePerInstanceConfigs.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeletePerInstanceConfigsOperationsClient); } /// @@ -2852,10 +3554,13 @@ public override Operation DeletePerInstanceConfigs(DeletePerInstanceConfigsInsta /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeletePerInstanceConfigsAsync(DeletePerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeletePerInstanceConfigsAsync(DeletePerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeletePerInstanceConfigsInstanceGroupManagerRequest(ref request, ref callSettings); - return _callDeletePerInstanceConfigs.Async(request, callSettings); + Operation response = await _callDeletePerInstanceConfigs.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeletePerInstanceConfigsOperationsClient); } /// @@ -2882,6 +3587,9 @@ public override InstanceGroupManager Get(GetInstanceGroupManagerRequest request, return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. /// @@ -2890,10 +3598,13 @@ public override InstanceGroupManager Get(GetInstanceGroupManagerRequest request, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertInstanceGroupManagerRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -2904,10 +3615,13 @@ public override Operation Insert(InsertInstanceGroupManagerRequest request, gaxg /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertInstanceGroupManagerRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -3006,16 +3720,22 @@ public override Operation Insert(InsertInstanceGroupManagerRequest request, gaxg return new gaxgrpc::GrpcPagedAsyncEnumerable(_callListPerInstanceConfigs, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchInstanceGroupManagerRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -3024,22 +3744,31 @@ public override Operation Patch(PatchInstanceGroupManagerRequest request, gaxgrp /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchInstanceGroupManagerRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } + /// The long-running operations client for PatchPerInstanceConfigs. + public override lro::OperationsClient PatchPerInstanceConfigsOperationsClient { get; } + /// /// Inserts or patches per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation PatchPerInstanceConfigs(PatchPerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation PatchPerInstanceConfigs(PatchPerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchPerInstanceConfigsInstanceGroupManagerRequest(ref request, ref callSettings); - return _callPatchPerInstanceConfigs.Sync(request, callSettings); + Operation response = _callPatchPerInstanceConfigs.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchPerInstanceConfigsOperationsClient); } /// @@ -3048,12 +3777,18 @@ public override Operation PatchPerInstanceConfigs(PatchPerInstanceConfigsInstanc /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchPerInstanceConfigsAsync(PatchPerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchPerInstanceConfigsAsync(PatchPerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchPerInstanceConfigsInstanceGroupManagerRequest(ref request, ref callSettings); - return _callPatchPerInstanceConfigs.Async(request, callSettings); + Operation response = await _callPatchPerInstanceConfigs.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchPerInstanceConfigsOperationsClient); } + /// The long-running operations client for RecreateInstances. + public override lro::OperationsClient RecreateInstancesOperationsClient { get; } + /// /// Flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group's current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking its currentAction field; for more information, see Checking the status of managed instances. /// @@ -3064,10 +3799,13 @@ public override Operation PatchPerInstanceConfigs(PatchPerInstanceConfigsInstanc /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation RecreateInstances(RecreateInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation RecreateInstances(RecreateInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RecreateInstancesInstanceGroupManagerRequest(ref request, ref callSettings); - return _callRecreateInstances.Sync(request, callSettings); + Operation response = _callRecreateInstances.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RecreateInstancesOperationsClient); } /// @@ -3080,12 +3818,18 @@ public override Operation RecreateInstances(RecreateInstancesInstanceGroupManage /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task RecreateInstancesAsync(RecreateInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> RecreateInstancesAsync(RecreateInstancesInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RecreateInstancesInstanceGroupManagerRequest(ref request, ref callSettings); - return _callRecreateInstances.Async(request, callSettings); + Operation response = await _callRecreateInstances.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RecreateInstancesOperationsClient); } + /// The long-running operations client for Resize. + public override lro::OperationsClient ResizeOperationsClient { get; } + /// /// Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. /// @@ -3100,10 +3844,13 @@ public override Operation RecreateInstances(RecreateInstancesInstanceGroupManage /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Resize(ResizeInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Resize(ResizeInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ResizeInstanceGroupManagerRequest(ref request, ref callSettings); - return _callResize.Sync(request, callSettings); + Operation response = _callResize.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), ResizeOperationsClient); } /// @@ -3120,22 +3867,31 @@ public override Operation Resize(ResizeInstanceGroupManagerRequest request, gaxg /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task ResizeAsync(ResizeInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> ResizeAsync(ResizeInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ResizeInstanceGroupManagerRequest(ref request, ref callSettings); - return _callResize.Async(request, callSettings); + Operation response = await _callResize.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), ResizeOperationsClient); } + /// The long-running operations client for SetInstanceTemplate. + public override lro::OperationsClient SetInstanceTemplateOperationsClient { get; } + /// /// Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetInstanceTemplate(SetInstanceTemplateInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetInstanceTemplate(SetInstanceTemplateInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetInstanceTemplateInstanceGroupManagerRequest(ref request, ref callSettings); - return _callSetInstanceTemplate.Sync(request, callSettings); + Operation response = _callSetInstanceTemplate.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetInstanceTemplateOperationsClient); } /// @@ -3144,22 +3900,31 @@ public override Operation SetInstanceTemplate(SetInstanceTemplateInstanceGroupMa /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetInstanceTemplateAsync(SetInstanceTemplateInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetInstanceTemplateAsync(SetInstanceTemplateInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetInstanceTemplateInstanceGroupManagerRequest(ref request, ref callSettings); - return _callSetInstanceTemplate.Async(request, callSettings); + Operation response = await _callSetInstanceTemplate.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetInstanceTemplateOperationsClient); } + /// The long-running operations client for SetTargetPools. + public override lro::OperationsClient SetTargetPoolsOperationsClient { get; } + /// /// Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetTargetPools(SetTargetPoolsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetTargetPools(SetTargetPoolsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetTargetPoolsInstanceGroupManagerRequest(ref request, ref callSettings); - return _callSetTargetPools.Sync(request, callSettings); + Operation response = _callSetTargetPools.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetTargetPoolsOperationsClient); } /// @@ -3168,22 +3933,31 @@ public override Operation SetTargetPools(SetTargetPoolsInstanceGroupManagerReque /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetTargetPoolsAsync(SetTargetPoolsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetTargetPoolsAsync(SetTargetPoolsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetTargetPoolsInstanceGroupManagerRequest(ref request, ref callSettings); - return _callSetTargetPools.Async(request, callSettings); + Operation response = await _callSetTargetPools.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetTargetPoolsOperationsClient); } + /// The long-running operations client for UpdatePerInstanceConfigs. + public override lro::OperationsClient UpdatePerInstanceConfigsOperationsClient { get; } + /// /// Inserts or updates per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation UpdatePerInstanceConfigs(UpdatePerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation UpdatePerInstanceConfigs(UpdatePerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdatePerInstanceConfigsInstanceGroupManagerRequest(ref request, ref callSettings); - return _callUpdatePerInstanceConfigs.Sync(request, callSettings); + Operation response = _callUpdatePerInstanceConfigs.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdatePerInstanceConfigsOperationsClient); } /// @@ -3192,10 +3966,13 @@ public override Operation UpdatePerInstanceConfigs(UpdatePerInstanceConfigsInsta /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task UpdatePerInstanceConfigsAsync(UpdatePerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> UpdatePerInstanceConfigsAsync(UpdatePerInstanceConfigsInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdatePerInstanceConfigsInstanceGroupManagerRequest(ref request, ref callSettings); - return _callUpdatePerInstanceConfigs.Async(request, callSettings); + Operation response = await _callUpdatePerInstanceConfigs.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdatePerInstanceConfigsOperationsClient); } } @@ -3289,4 +4066,18 @@ public partial class InstanceGroupManagersListPerInstanceConfigsResp : gaxgrpc:: sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class InstanceGroupManagers + { + public partial class InstanceGroupManagersClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to ZoneOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForZoneOperations() => + ZoneOperations.ZoneOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InstanceGroupsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InstanceGroupsClient.g.cs index 67fc25cea1a1..4ae5dfc54b21 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InstanceGroupsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InstanceGroupsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,14 +46,19 @@ private InstanceGroupsSettings(InstanceGroupsSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AddInstancesSettings = existing.AddInstancesSettings; + AddInstancesOperationsSettings = existing.AddInstancesOperationsSettings.Clone(); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; ListInstancesSettings = existing.ListInstancesSettings; RemoveInstancesSettings = existing.RemoveInstancesSettings; + RemoveInstancesOperationsSettings = existing.RemoveInstancesOperationsSettings.Clone(); SetNamedPortsSettings = existing.SetNamedPortsSettings; + SetNamedPortsOperationsSettings = existing.SetNamedPortsOperationsSettings.Clone(); OnCopy(existing); } @@ -70,6 +76,24 @@ private InstanceGroupsSettings(InstanceGroupsSettings existing) : base(existing) /// public gaxgrpc::CallSettings AddInstancesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstanceGroupsClient.AddInstances and + /// InstanceGroupsClient.AddInstancesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings AddInstancesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstanceGroupsClient.AggregatedList and InstanceGroupsClient.AggregatedListAsync. @@ -94,6 +118,24 @@ private InstanceGroupsSettings(InstanceGroupsSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstanceGroupsClient.Delete and + /// InstanceGroupsClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to InstanceGroupsClient.Get /// and InstanceGroupsClient.GetAsync. @@ -118,6 +160,24 @@ private InstanceGroupsSettings(InstanceGroupsSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstanceGroupsClient.Insert and + /// InstanceGroupsClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to InstanceGroupsClient.List /// and InstanceGroupsClient.ListAsync. @@ -154,6 +214,24 @@ private InstanceGroupsSettings(InstanceGroupsSettings existing) : base(existing) /// public gaxgrpc::CallSettings RemoveInstancesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstanceGroupsClient.RemoveInstances and + /// InstanceGroupsClient.RemoveInstancesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings RemoveInstancesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstanceGroupsClient.SetNamedPorts and InstanceGroupsClient.SetNamedPortsAsync. @@ -166,6 +244,24 @@ private InstanceGroupsSettings(InstanceGroupsSettings existing) : base(existing) /// public gaxgrpc::CallSettings SetNamedPortsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstanceGroupsClient.SetNamedPorts and + /// InstanceGroupsClient.SetNamedPortsAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetNamedPortsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public InstanceGroupsSettings Clone() => new InstanceGroupsSettings(this); @@ -335,7 +431,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddInstances(AddInstancesInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddInstances(AddInstancesInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -344,7 +440,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddInstancesAsync(AddInstancesInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddInstancesAsync(AddInstancesInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -353,9 +449,35 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddInstancesAsync(AddInstancesInstanceGroupRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddInstancesAsync(AddInstancesInstanceGroupRequest request, st::CancellationToken cancellationToken) => AddInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for AddInstances. + public virtual lro::OperationsClient AddInstancesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of AddInstances. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceAddInstances(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddInstancesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// AddInstances. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceAddInstancesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddInstancesOperationsClient, callSettings); + /// /// Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read Adding instances for more information. /// @@ -373,7 +495,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddInstances(string project, string zone, string instanceGroup, InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddInstances(string project, string zone, string instanceGroup, InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => AddInstances(new AddInstancesInstanceGroupRequest { InstanceGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroup, nameof(instanceGroup)), @@ -399,7 +521,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddInstancesAsync(string project, string zone, string instanceGroup, InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddInstancesAsync(string project, string zone, string instanceGroup, InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => AddInstancesAsync(new AddInstancesInstanceGroupRequest { InstanceGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroup, nameof(instanceGroup)), @@ -425,7 +547,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddInstancesAsync(string project, string zone, string instanceGroup, InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddInstancesAsync(string project, string zone, string instanceGroup, InstanceGroupsAddInstancesRequest instanceGroupsAddInstancesRequestResource, st::CancellationToken cancellationToken) => AddInstancesAsync(project, zone, instanceGroup, instanceGroupsAddInstancesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -504,7 +626,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -513,7 +635,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -522,9 +644,35 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteInstanceGroupRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteInstanceGroupRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information. /// @@ -539,7 +687,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string zone, string instanceGroup, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string zone, string instanceGroup, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteInstanceGroupRequest { InstanceGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroup, nameof(instanceGroup)), @@ -561,7 +709,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string zone, string instanceGroup, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string zone, string instanceGroup, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteInstanceGroupRequest { InstanceGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroup, nameof(instanceGroup)), @@ -583,7 +731,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string zone, string instanceGroup, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string zone, string instanceGroup, st::CancellationToken cancellationToken) => DeleteAsync(project, zone, instanceGroup, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -692,7 +840,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -701,7 +849,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -710,9 +858,35 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertInstanceGroupRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertInstanceGroupRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates an instance group in the specified project using the parameters that are included in the request. /// @@ -727,7 +901,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string zone, InstanceGroup instanceGroupResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string zone, InstanceGroup instanceGroupResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertInstanceGroupRequest { InstanceGroupResource = gax::GaxPreconditions.CheckNotNull(instanceGroupResource, nameof(instanceGroupResource)), @@ -749,7 +923,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string zone, InstanceGroup instanceGroupResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string zone, InstanceGroup instanceGroupResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertInstanceGroupRequest { InstanceGroupResource = gax::GaxPreconditions.CheckNotNull(instanceGroupResource, nameof(instanceGroupResource)), @@ -771,7 +945,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string zone, InstanceGroup instanceGroupResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string zone, InstanceGroup instanceGroupResource, st::CancellationToken cancellationToken) => InsertAsync(project, zone, instanceGroupResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -954,7 +1128,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RemoveInstances(RemoveInstancesInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RemoveInstances(RemoveInstancesInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -965,7 +1139,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RemoveInstancesAsync(RemoveInstancesInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RemoveInstancesAsync(RemoveInstancesInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -976,9 +1150,35 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RemoveInstancesAsync(RemoveInstancesInstanceGroupRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> RemoveInstancesAsync(RemoveInstancesInstanceGroupRequest request, st::CancellationToken cancellationToken) => RemoveInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for RemoveInstances. + public virtual lro::OperationsClient RemoveInstancesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of RemoveInstances. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceRemoveInstances(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RemoveInstancesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// RemoveInstances. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceRemoveInstancesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RemoveInstancesOperationsClient, callSettings); + /// /// Removes one or more instances from the specified instance group, but does not delete those instances. /// @@ -998,7 +1198,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RemoveInstances(string project, string zone, string instanceGroup, InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RemoveInstances(string project, string zone, string instanceGroup, InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => RemoveInstances(new RemoveInstancesInstanceGroupRequest { InstanceGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroup, nameof(instanceGroup)), @@ -1026,7 +1226,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RemoveInstancesAsync(string project, string zone, string instanceGroup, InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RemoveInstancesAsync(string project, string zone, string instanceGroup, InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => RemoveInstancesAsync(new RemoveInstancesInstanceGroupRequest { InstanceGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroup, nameof(instanceGroup)), @@ -1054,7 +1254,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RemoveInstancesAsync(string project, string zone, string instanceGroup, InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> RemoveInstancesAsync(string project, string zone, string instanceGroup, InstanceGroupsRemoveInstancesRequest instanceGroupsRemoveInstancesRequestResource, st::CancellationToken cancellationToken) => RemoveInstancesAsync(project, zone, instanceGroup, instanceGroupsRemoveInstancesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1063,7 +1263,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetNamedPorts(SetNamedPortsInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetNamedPorts(SetNamedPortsInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1072,7 +1272,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetNamedPortsAsync(SetNamedPortsInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetNamedPortsAsync(SetNamedPortsInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1081,9 +1281,35 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetNamedPortsAsync(SetNamedPortsInstanceGroupRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetNamedPortsAsync(SetNamedPortsInstanceGroupRequest request, st::CancellationToken cancellationToken) => SetNamedPortsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetNamedPorts. + public virtual lro::OperationsClient SetNamedPortsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetNamedPorts. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetNamedPorts(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetNamedPortsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetNamedPorts. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetNamedPortsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetNamedPortsOperationsClient, callSettings); + /// /// Sets the named ports for the specified instance group. /// @@ -1101,7 +1327,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetNamedPorts(string project, string zone, string instanceGroup, InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetNamedPorts(string project, string zone, string instanceGroup, InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetNamedPorts(new SetNamedPortsInstanceGroupRequest { InstanceGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroup, nameof(instanceGroup)), @@ -1127,7 +1353,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetNamedPortsAsync(string project, string zone, string instanceGroup, InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetNamedPortsAsync(string project, string zone, string instanceGroup, InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetNamedPortsAsync(new SetNamedPortsInstanceGroupRequest { InstanceGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroup, nameof(instanceGroup)), @@ -1153,7 +1379,7 @@ internal static InstanceGroupsClient Create(grpccore::CallInvoker callInvoker, I /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetNamedPortsAsync(string project, string zone, string instanceGroup, InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetNamedPortsAsync(string project, string zone, string instanceGroup, InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource, st::CancellationToken cancellationToken) => SetNamedPortsAsync(project, zone, instanceGroup, instanceGroupsSetNamedPortsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -1191,6 +1417,11 @@ public InstanceGroupsClientImpl(InstanceGroups.InstanceGroupsClient grpcClient, GrpcClient = grpcClient; InstanceGroupsSettings effectiveSettings = settings ?? InstanceGroupsSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + AddInstancesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.AddInstancesOperationsSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.InsertOperationsSettings); + RemoveInstancesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.RemoveInstancesOperationsSettings); + SetNamedPortsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.SetNamedPortsOperationsSettings); _callAddInstances = clientHelper.BuildApiCall(grpcClient.AddInstancesAsync, grpcClient.AddInstances, effectiveSettings.AddInstancesSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("zone", request => request.Zone).WithGoogleRequestParam("instance_group", request => request.InstanceGroup); Modify_ApiCall(ref _callAddInstances); Modify_AddInstancesApiCall(ref _callAddInstances); @@ -1264,16 +1495,22 @@ public InstanceGroupsClientImpl(InstanceGroups.InstanceGroupsClient grpcClient, partial void Modify_SetNamedPortsInstanceGroupRequest(ref SetNamedPortsInstanceGroupRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for AddInstances. + public override lro::OperationsClient AddInstancesOperationsClient { get; } + /// /// Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read Adding instances for more information. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation AddInstances(AddInstancesInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation AddInstances(AddInstancesInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddInstancesInstanceGroupRequest(ref request, ref callSettings); - return _callAddInstances.Sync(request, callSettings); + Operation response = _callAddInstances.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddInstancesOperationsClient); } /// @@ -1282,10 +1519,13 @@ public override Operation AddInstances(AddInstancesInstanceGroupRequest request, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task AddInstancesAsync(AddInstancesInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> AddInstancesAsync(AddInstancesInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddInstancesInstanceGroupRequest(ref request, ref callSettings); - return _callAddInstances.Async(request, callSettings); + Operation response = await _callAddInstances.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddInstancesOperationsClient); } /// @@ -1314,16 +1554,22 @@ public override Operation AddInstances(AddInstancesInstanceGroupRequest request, return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteInstanceGroupRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1332,10 +1578,13 @@ public override Operation Delete(DeleteInstanceGroupRequest request, gaxgrpc::Ca /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteInstanceGroupRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1366,16 +1615,22 @@ public override InstanceGroup Get(GetInstanceGroupRequest request, gaxgrpc::Call return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates an instance group in the specified project using the parameters that are included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertInstanceGroupRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1384,10 +1639,13 @@ public override Operation Insert(InsertInstanceGroupRequest request, gaxgrpc::Ca /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertInstanceGroupRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1442,6 +1700,9 @@ public override Operation Insert(InsertInstanceGroupRequest request, gaxgrpc::Ca return new gaxgrpc::GrpcPagedAsyncEnumerable(_callListInstances, request, callSettings); } + /// The long-running operations client for RemoveInstances. + public override lro::OperationsClient RemoveInstancesOperationsClient { get; } + /// /// Removes one or more instances from the specified instance group, but does not delete those instances. /// @@ -1450,10 +1711,13 @@ public override Operation Insert(InsertInstanceGroupRequest request, gaxgrpc::Ca /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation RemoveInstances(RemoveInstancesInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation RemoveInstances(RemoveInstancesInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RemoveInstancesInstanceGroupRequest(ref request, ref callSettings); - return _callRemoveInstances.Sync(request, callSettings); + Operation response = _callRemoveInstances.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RemoveInstancesOperationsClient); } /// @@ -1464,22 +1728,31 @@ public override Operation RemoveInstances(RemoveInstancesInstanceGroupRequest re /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task RemoveInstancesAsync(RemoveInstancesInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> RemoveInstancesAsync(RemoveInstancesInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RemoveInstancesInstanceGroupRequest(ref request, ref callSettings); - return _callRemoveInstances.Async(request, callSettings); + Operation response = await _callRemoveInstances.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RemoveInstancesOperationsClient); } + /// The long-running operations client for SetNamedPorts. + public override lro::OperationsClient SetNamedPortsOperationsClient { get; } + /// /// Sets the named ports for the specified instance group. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetNamedPorts(SetNamedPortsInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetNamedPorts(SetNamedPortsInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetNamedPortsInstanceGroupRequest(ref request, ref callSettings); - return _callSetNamedPorts.Sync(request, callSettings); + Operation response = _callSetNamedPorts.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetNamedPortsOperationsClient); } /// @@ -1488,10 +1761,13 @@ public override Operation SetNamedPorts(SetNamedPortsInstanceGroupRequest reques /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetNamedPortsAsync(SetNamedPortsInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetNamedPortsAsync(SetNamedPortsInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetNamedPortsInstanceGroupRequest(ref request, ref callSettings); - return _callSetNamedPorts.Async(request, callSettings); + Operation response = await _callSetNamedPorts.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetNamedPortsOperationsClient); } } @@ -1549,4 +1825,18 @@ public partial class InstanceGroupsListInstances : gaxgrpc::IPageResponse GetEnumerator(); } + + public static partial class InstanceGroups + { + public partial class InstanceGroupsClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to ZoneOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForZoneOperations() => + ZoneOperations.ZoneOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InstanceTemplatesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InstanceTemplatesClient.g.cs index df4add7b3c22..9c3f139e4a3c 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InstanceTemplatesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InstanceTemplatesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,9 +46,11 @@ private InstanceTemplatesSettings(InstanceTemplatesSettings existing) : base(exi { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; GetIamPolicySettings = existing.GetIamPolicySettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; SetIamPolicySettings = existing.SetIamPolicySettings; TestIamPermissionsSettings = existing.TestIamPermissionsSettings; @@ -68,6 +71,24 @@ private InstanceTemplatesSettings(InstanceTemplatesSettings existing) : base(exi /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstanceTemplatesClient.Delete and + /// InstanceTemplatesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to InstanceTemplatesClient.Get /// and InstanceTemplatesClient.GetAsync. @@ -104,6 +125,24 @@ private InstanceTemplatesSettings(InstanceTemplatesSettings existing) : base(exi /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstanceTemplatesClient.Insert and + /// InstanceTemplatesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstanceTemplatesClient.List and InstanceTemplatesClient.ListAsync. @@ -310,7 +349,7 @@ internal static InstanceTemplatesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteInstanceTemplateRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteInstanceTemplateRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -319,7 +358,7 @@ internal static InstanceTemplatesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteInstanceTemplateRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteInstanceTemplateRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -328,9 +367,35 @@ internal static InstanceTemplatesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteInstanceTemplateRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteInstanceTemplateRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group. /// @@ -342,7 +407,7 @@ internal static InstanceTemplatesClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string instanceTemplate, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string instanceTemplate, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteInstanceTemplateRequest { InstanceTemplate = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceTemplate, nameof(instanceTemplate)), @@ -360,7 +425,7 @@ internal static InstanceTemplatesClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string instanceTemplate, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string instanceTemplate, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteInstanceTemplateRequest { InstanceTemplate = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceTemplate, nameof(instanceTemplate)), @@ -378,7 +443,7 @@ internal static InstanceTemplatesClient Create(grpccore::CallInvoker callInvoker /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string instanceTemplate, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string instanceTemplate, st::CancellationToken cancellationToken) => DeleteAsync(project, instanceTemplate, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -541,7 +606,7 @@ internal static InstanceTemplatesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertInstanceTemplateRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertInstanceTemplateRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -550,7 +615,7 @@ internal static InstanceTemplatesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertInstanceTemplateRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertInstanceTemplateRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -559,9 +624,35 @@ internal static InstanceTemplatesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertInstanceTemplateRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertInstanceTemplateRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template. /// @@ -573,7 +664,7 @@ internal static InstanceTemplatesClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, InstanceTemplate instanceTemplateResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, InstanceTemplate instanceTemplateResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertInstanceTemplateRequest { InstanceTemplateResource = gax::GaxPreconditions.CheckNotNull(instanceTemplateResource, nameof(instanceTemplateResource)), @@ -591,7 +682,7 @@ internal static InstanceTemplatesClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, InstanceTemplate instanceTemplateResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, InstanceTemplate instanceTemplateResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertInstanceTemplateRequest { InstanceTemplateResource = gax::GaxPreconditions.CheckNotNull(instanceTemplateResource, nameof(instanceTemplateResource)), @@ -609,7 +700,7 @@ internal static InstanceTemplatesClient Create(grpccore::CallInvoker callInvoker /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, InstanceTemplate instanceTemplateResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, InstanceTemplate instanceTemplateResource, st::CancellationToken cancellationToken) => InsertAsync(project, instanceTemplateResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -885,6 +976,8 @@ public InstanceTemplatesClientImpl(InstanceTemplates.InstanceTemplatesClient grp GrpcClient = grpcClient; InstanceTemplatesSettings effectiveSettings = settings ?? InstanceTemplatesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("instance_template", request => request.InstanceTemplate); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -944,16 +1037,22 @@ public InstanceTemplatesClientImpl(InstanceTemplates.InstanceTemplatesClient grp partial void Modify_TestIamPermissionsInstanceTemplateRequest(ref TestIamPermissionsInstanceTemplateRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteInstanceTemplateRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteInstanceTemplateRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteInstanceTemplateRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -962,10 +1061,13 @@ public override Operation Delete(DeleteInstanceTemplateRequest request, gaxgrpc: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteInstanceTemplateRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteInstanceTemplateRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteInstanceTemplateRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1016,16 +1118,22 @@ public override Policy GetIamPolicy(GetIamPolicyInstanceTemplateRequest request, return _callGetIamPolicy.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertInstanceTemplateRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertInstanceTemplateRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertInstanceTemplateRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1034,10 +1142,13 @@ public override Operation Insert(InsertInstanceTemplateRequest request, gaxgrpc: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertInstanceTemplateRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertInstanceTemplateRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertInstanceTemplateRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1130,4 +1241,18 @@ public partial class InstanceTemplateList : gaxgrpc::IPageResponse GetEnumerator(); } + + public static partial class InstanceTemplates + { + public partial class InstanceTemplatesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InstancesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InstancesClient.g.cs index 171fd8133a7e..e97a9c825069 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InstancesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InstancesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,13 +46,20 @@ private InstancesSettings(InstancesSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AddAccessConfigSettings = existing.AddAccessConfigSettings; + AddAccessConfigOperationsSettings = existing.AddAccessConfigOperationsSettings.Clone(); AddResourcePoliciesSettings = existing.AddResourcePoliciesSettings; + AddResourcePoliciesOperationsSettings = existing.AddResourcePoliciesOperationsSettings.Clone(); AggregatedListSettings = existing.AggregatedListSettings; AttachDiskSettings = existing.AttachDiskSettings; + AttachDiskOperationsSettings = existing.AttachDiskOperationsSettings.Clone(); BulkInsertSettings = existing.BulkInsertSettings; + BulkInsertOperationsSettings = existing.BulkInsertOperationsSettings.Clone(); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); DeleteAccessConfigSettings = existing.DeleteAccessConfigSettings; + DeleteAccessConfigOperationsSettings = existing.DeleteAccessConfigOperationsSettings.Clone(); DetachDiskSettings = existing.DetachDiskSettings; + DetachDiskOperationsSettings = existing.DetachDiskOperationsSettings.Clone(); GetSettings = existing.GetSettings; GetEffectiveFirewallsSettings = existing.GetEffectiveFirewallsSettings; GetGuestAttributesSettings = existing.GetGuestAttributesSettings; @@ -60,32 +68,55 @@ private InstancesSettings(InstancesSettings existing) : base(existing) GetSerialPortOutputSettings = existing.GetSerialPortOutputSettings; GetShieldedInstanceIdentitySettings = existing.GetShieldedInstanceIdentitySettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; ListReferrersSettings = existing.ListReferrersSettings; RemoveResourcePoliciesSettings = existing.RemoveResourcePoliciesSettings; + RemoveResourcePoliciesOperationsSettings = existing.RemoveResourcePoliciesOperationsSettings.Clone(); ResetSettings = existing.ResetSettings; + ResetOperationsSettings = existing.ResetOperationsSettings.Clone(); SetDeletionProtectionSettings = existing.SetDeletionProtectionSettings; + SetDeletionProtectionOperationsSettings = existing.SetDeletionProtectionOperationsSettings.Clone(); SetDiskAutoDeleteSettings = existing.SetDiskAutoDeleteSettings; + SetDiskAutoDeleteOperationsSettings = existing.SetDiskAutoDeleteOperationsSettings.Clone(); SetIamPolicySettings = existing.SetIamPolicySettings; SetLabelsSettings = existing.SetLabelsSettings; + SetLabelsOperationsSettings = existing.SetLabelsOperationsSettings.Clone(); SetMachineResourcesSettings = existing.SetMachineResourcesSettings; + SetMachineResourcesOperationsSettings = existing.SetMachineResourcesOperationsSettings.Clone(); SetMachineTypeSettings = existing.SetMachineTypeSettings; + SetMachineTypeOperationsSettings = existing.SetMachineTypeOperationsSettings.Clone(); SetMetadataSettings = existing.SetMetadataSettings; + SetMetadataOperationsSettings = existing.SetMetadataOperationsSettings.Clone(); SetMinCpuPlatformSettings = existing.SetMinCpuPlatformSettings; + SetMinCpuPlatformOperationsSettings = existing.SetMinCpuPlatformOperationsSettings.Clone(); SetSchedulingSettings = existing.SetSchedulingSettings; + SetSchedulingOperationsSettings = existing.SetSchedulingOperationsSettings.Clone(); SetServiceAccountSettings = existing.SetServiceAccountSettings; + SetServiceAccountOperationsSettings = existing.SetServiceAccountOperationsSettings.Clone(); SetShieldedInstanceIntegrityPolicySettings = existing.SetShieldedInstanceIntegrityPolicySettings; + SetShieldedInstanceIntegrityPolicyOperationsSettings = existing.SetShieldedInstanceIntegrityPolicyOperationsSettings.Clone(); SetTagsSettings = existing.SetTagsSettings; + SetTagsOperationsSettings = existing.SetTagsOperationsSettings.Clone(); SimulateMaintenanceEventSettings = existing.SimulateMaintenanceEventSettings; + SimulateMaintenanceEventOperationsSettings = existing.SimulateMaintenanceEventOperationsSettings.Clone(); StartSettings = existing.StartSettings; + StartOperationsSettings = existing.StartOperationsSettings.Clone(); StartWithEncryptionKeySettings = existing.StartWithEncryptionKeySettings; + StartWithEncryptionKeyOperationsSettings = existing.StartWithEncryptionKeyOperationsSettings.Clone(); StopSettings = existing.StopSettings; + StopOperationsSettings = existing.StopOperationsSettings.Clone(); TestIamPermissionsSettings = existing.TestIamPermissionsSettings; UpdateSettings = existing.UpdateSettings; + UpdateOperationsSettings = existing.UpdateOperationsSettings.Clone(); UpdateAccessConfigSettings = existing.UpdateAccessConfigSettings; + UpdateAccessConfigOperationsSettings = existing.UpdateAccessConfigOperationsSettings.Clone(); UpdateDisplayDeviceSettings = existing.UpdateDisplayDeviceSettings; + UpdateDisplayDeviceOperationsSettings = existing.UpdateDisplayDeviceOperationsSettings.Clone(); UpdateNetworkInterfaceSettings = existing.UpdateNetworkInterfaceSettings; + UpdateNetworkInterfaceOperationsSettings = existing.UpdateNetworkInterfaceOperationsSettings.Clone(); UpdateShieldedInstanceConfigSettings = existing.UpdateShieldedInstanceConfigSettings; + UpdateShieldedInstanceConfigOperationsSettings = existing.UpdateShieldedInstanceConfigOperationsSettings.Clone(); OnCopy(existing); } @@ -103,6 +134,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings AddAccessConfigSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.AddAccessConfig and + /// InstancesClient.AddAccessConfigAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings AddAccessConfigOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstancesClient.AddResourcePolicies and InstancesClient.AddResourcePoliciesAsync. @@ -115,6 +164,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings AddResourcePoliciesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.AddResourcePolicies and + /// InstancesClient.AddResourcePoliciesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings AddResourcePoliciesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstancesClient.AggregatedList and InstancesClient.AggregatedListAsync. @@ -139,6 +206,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings AttachDiskSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.AttachDisk and + /// InstancesClient.AttachDiskAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings AttachDiskOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to InstancesClient.BulkInsert /// and InstancesClient.BulkInsertAsync. @@ -151,6 +236,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings BulkInsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.BulkInsert and + /// InstancesClient.BulkInsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings BulkInsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to InstancesClient.Delete /// and InstancesClient.DeleteAsync. @@ -163,6 +266,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.Delete and + /// InstancesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstancesClient.DeleteAccessConfig and InstancesClient.DeleteAccessConfigAsync. @@ -175,6 +296,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteAccessConfigSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.DeleteAccessConfig and + /// InstancesClient.DeleteAccessConfigAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteAccessConfigOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to InstancesClient.DetachDisk /// and InstancesClient.DetachDiskAsync. @@ -187,6 +326,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings DetachDiskSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.DetachDisk and + /// InstancesClient.DetachDiskAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DetachDiskOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to InstancesClient.Get and /// InstancesClient.GetAsync. @@ -284,6 +441,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.Insert and + /// InstancesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to InstancesClient.List /// and InstancesClient.ListAsync. @@ -320,6 +495,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings RemoveResourcePoliciesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.RemoveResourcePolicies and + /// InstancesClient.RemoveResourcePoliciesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings RemoveResourcePoliciesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to InstancesClient.Reset /// and InstancesClient.ResetAsync. @@ -332,6 +525,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings ResetSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.Reset and InstancesClient.ResetAsync + /// . + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings ResetOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstancesClient.SetDeletionProtection and InstancesClient.SetDeletionProtectionAsync. @@ -344,6 +555,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings SetDeletionProtectionSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.SetDeletionProtection and + /// InstancesClient.SetDeletionProtectionAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetDeletionProtectionOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstancesClient.SetDiskAutoDelete and InstancesClient.SetDiskAutoDeleteAsync. @@ -356,6 +585,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings SetDiskAutoDeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.SetDiskAutoDelete and + /// InstancesClient.SetDiskAutoDeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetDiskAutoDeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstancesClient.SetIamPolicy and InstancesClient.SetIamPolicyAsync. @@ -380,6 +627,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings SetLabelsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.SetLabels and + /// InstancesClient.SetLabelsAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetLabelsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstancesClient.SetMachineResources and InstancesClient.SetMachineResourcesAsync. @@ -392,6 +657,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings SetMachineResourcesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.SetMachineResources and + /// InstancesClient.SetMachineResourcesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetMachineResourcesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstancesClient.SetMachineType and InstancesClient.SetMachineTypeAsync. @@ -404,6 +687,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings SetMachineTypeSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.SetMachineType and + /// InstancesClient.SetMachineTypeAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetMachineTypeOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to InstancesClient.SetMetadata /// and InstancesClient.SetMetadataAsync. @@ -416,6 +717,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings SetMetadataSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.SetMetadata and + /// InstancesClient.SetMetadataAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetMetadataOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstancesClient.SetMinCpuPlatform and InstancesClient.SetMinCpuPlatformAsync. @@ -428,6 +747,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings SetMinCpuPlatformSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.SetMinCpuPlatform and + /// InstancesClient.SetMinCpuPlatformAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetMinCpuPlatformOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstancesClient.SetScheduling and InstancesClient.SetSchedulingAsync. @@ -440,6 +777,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings SetSchedulingSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.SetScheduling and + /// InstancesClient.SetSchedulingAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetSchedulingOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstancesClient.SetServiceAccount and InstancesClient.SetServiceAccountAsync. @@ -452,6 +807,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings SetServiceAccountSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.SetServiceAccount and + /// InstancesClient.SetServiceAccountAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetServiceAccountOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstancesClient.SetShieldedInstanceIntegrityPolicy and @@ -465,6 +838,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings SetShieldedInstanceIntegrityPolicySettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.SetShieldedInstanceIntegrityPolicy and + /// InstancesClient.SetShieldedInstanceIntegrityPolicyAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetShieldedInstanceIntegrityPolicyOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to InstancesClient.SetTags /// and InstancesClient.SetTagsAsync. @@ -477,6 +868,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings SetTagsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.SetTags and + /// InstancesClient.SetTagsAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetTagsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstancesClient.SimulateMaintenanceEvent and InstancesClient.SimulateMaintenanceEventAsync. @@ -489,6 +898,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings SimulateMaintenanceEventSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.SimulateMaintenanceEvent and + /// InstancesClient.SimulateMaintenanceEventAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SimulateMaintenanceEventOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to InstancesClient.Start /// and InstancesClient.StartAsync. @@ -501,6 +928,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings StartSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.Start and InstancesClient.StartAsync + /// . + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings StartOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstancesClient.StartWithEncryptionKey and InstancesClient.StartWithEncryptionKeyAsync. @@ -513,6 +958,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings StartWithEncryptionKeySettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.StartWithEncryptionKey and + /// InstancesClient.StartWithEncryptionKeyAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings StartWithEncryptionKeyOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to InstancesClient.Stop /// and InstancesClient.StopAsync. @@ -525,6 +988,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings StopSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.Stop and InstancesClient.StopAsync + /// . + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings StopOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstancesClient.TestIamPermissions and InstancesClient.TestIamPermissionsAsync. @@ -549,6 +1030,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings UpdateSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.Update and + /// InstancesClient.UpdateAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings UpdateOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstancesClient.UpdateAccessConfig and InstancesClient.UpdateAccessConfigAsync. @@ -561,6 +1060,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings UpdateAccessConfigSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.UpdateAccessConfig and + /// InstancesClient.UpdateAccessConfigAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings UpdateAccessConfigOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstancesClient.UpdateDisplayDevice and InstancesClient.UpdateDisplayDeviceAsync. @@ -573,6 +1090,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings UpdateDisplayDeviceSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.UpdateDisplayDevice and + /// InstancesClient.UpdateDisplayDeviceAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings UpdateDisplayDeviceOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstancesClient.UpdateNetworkInterface and InstancesClient.UpdateNetworkInterfaceAsync. @@ -585,6 +1120,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings UpdateNetworkInterfaceSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.UpdateNetworkInterface and + /// InstancesClient.UpdateNetworkInterfaceAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings UpdateNetworkInterfaceOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InstancesClient.UpdateShieldedInstanceConfig and InstancesClient.UpdateShieldedInstanceConfigAsync @@ -598,6 +1151,24 @@ private InstancesSettings(InstancesSettings existing) : base(existing) /// public gaxgrpc::CallSettings UpdateShieldedInstanceConfigSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InstancesClient.UpdateShieldedInstanceConfig and + /// InstancesClient.UpdateShieldedInstanceConfigAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings UpdateShieldedInstanceConfigOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public InstancesSettings Clone() => new InstancesSettings(this); @@ -766,7 +1337,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddAccessConfig(AddAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddAccessConfig(AddAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -775,7 +1346,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddAccessConfigAsync(AddAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddAccessConfigAsync(AddAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -784,9 +1355,35 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddAccessConfigAsync(AddAccessConfigInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddAccessConfigAsync(AddAccessConfigInstanceRequest request, st::CancellationToken cancellationToken) => AddAccessConfigAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for AddAccessConfig. + public virtual lro::OperationsClient AddAccessConfigOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of AddAccessConfig. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceAddAccessConfig(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddAccessConfigOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// AddAccessConfig. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceAddAccessConfigAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddAccessConfigOperationsClient, callSettings); + /// /// Adds an access config to an instance's network interface. /// @@ -807,7 +1404,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddAccessConfig(string project, string zone, string instance, string networkInterface, AccessConfig accessConfigResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddAccessConfig(string project, string zone, string instance, string networkInterface, AccessConfig accessConfigResource, gaxgrpc::CallSettings callSettings = null) => AddAccessConfig(new AddAccessConfigInstanceRequest { AccessConfigResource = gax::GaxPreconditions.CheckNotNull(accessConfigResource, nameof(accessConfigResource)), @@ -837,7 +1434,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddAccessConfigAsync(string project, string zone, string instance, string networkInterface, AccessConfig accessConfigResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddAccessConfigAsync(string project, string zone, string instance, string networkInterface, AccessConfig accessConfigResource, gaxgrpc::CallSettings callSettings = null) => AddAccessConfigAsync(new AddAccessConfigInstanceRequest { AccessConfigResource = gax::GaxPreconditions.CheckNotNull(accessConfigResource, nameof(accessConfigResource)), @@ -867,7 +1464,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddAccessConfigAsync(string project, string zone, string instance, string networkInterface, AccessConfig accessConfigResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddAccessConfigAsync(string project, string zone, string instance, string networkInterface, AccessConfig accessConfigResource, st::CancellationToken cancellationToken) => AddAccessConfigAsync(project, zone, instance, networkInterface, accessConfigResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -876,7 +1473,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddResourcePolicies(AddResourcePoliciesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddResourcePolicies(AddResourcePoliciesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -885,7 +1482,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddResourcePoliciesAsync(AddResourcePoliciesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddResourcePoliciesAsync(AddResourcePoliciesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -894,9 +1491,36 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddResourcePoliciesAsync(AddResourcePoliciesInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddResourcePoliciesAsync(AddResourcePoliciesInstanceRequest request, st::CancellationToken cancellationToken) => AddResourcePoliciesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for AddResourcePolicies. + public virtual lro::OperationsClient AddResourcePoliciesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of AddResourcePolicies + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceAddResourcePolicies(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddResourcePoliciesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// AddResourcePolicies. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceAddResourcePoliciesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddResourcePoliciesOperationsClient, callSettings); + /// /// Adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations. /// @@ -914,7 +1538,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddResourcePolicies(string project, string zone, string instance, InstancesAddResourcePoliciesRequest instancesAddResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddResourcePolicies(string project, string zone, string instance, InstancesAddResourcePoliciesRequest instancesAddResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => AddResourcePolicies(new AddResourcePoliciesInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -940,7 +1564,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddResourcePoliciesAsync(string project, string zone, string instance, InstancesAddResourcePoliciesRequest instancesAddResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddResourcePoliciesAsync(string project, string zone, string instance, InstancesAddResourcePoliciesRequest instancesAddResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => AddResourcePoliciesAsync(new AddResourcePoliciesInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -966,7 +1590,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddResourcePoliciesAsync(string project, string zone, string instance, InstancesAddResourcePoliciesRequest instancesAddResourcePoliciesRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddResourcePoliciesAsync(string project, string zone, string instance, InstancesAddResourcePoliciesRequest instancesAddResourcePoliciesRequestResource, st::CancellationToken cancellationToken) => AddResourcePoliciesAsync(project, zone, instance, instancesAddResourcePoliciesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1045,7 +1669,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AttachDisk(AttachDiskInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AttachDisk(AttachDiskInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1054,7 +1678,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AttachDiskAsync(AttachDiskInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AttachDiskAsync(AttachDiskInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1063,9 +1687,35 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AttachDiskAsync(AttachDiskInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> AttachDiskAsync(AttachDiskInstanceRequest request, st::CancellationToken cancellationToken) => AttachDiskAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for AttachDisk. + public virtual lro::OperationsClient AttachDiskOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of AttachDisk. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceAttachDisk(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AttachDiskOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// AttachDisk. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceAttachDiskAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AttachDiskOperationsClient, callSettings); + /// /// Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance. /// @@ -1083,7 +1733,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AttachDisk(string project, string zone, string instance, AttachedDisk attachedDiskResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AttachDisk(string project, string zone, string instance, AttachedDisk attachedDiskResource, gaxgrpc::CallSettings callSettings = null) => AttachDisk(new AttachDiskInstanceRequest { AttachedDiskResource = gax::GaxPreconditions.CheckNotNull(attachedDiskResource, nameof(attachedDiskResource)), @@ -1109,7 +1759,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AttachDiskAsync(string project, string zone, string instance, AttachedDisk attachedDiskResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AttachDiskAsync(string project, string zone, string instance, AttachedDisk attachedDiskResource, gaxgrpc::CallSettings callSettings = null) => AttachDiskAsync(new AttachDiskInstanceRequest { AttachedDiskResource = gax::GaxPreconditions.CheckNotNull(attachedDiskResource, nameof(attachedDiskResource)), @@ -1135,7 +1785,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AttachDiskAsync(string project, string zone, string instance, AttachedDisk attachedDiskResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> AttachDiskAsync(string project, string zone, string instance, AttachedDisk attachedDiskResource, st::CancellationToken cancellationToken) => AttachDiskAsync(project, zone, instance, attachedDiskResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1144,7 +1794,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation BulkInsert(BulkInsertInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation BulkInsert(BulkInsertInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1153,7 +1803,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task BulkInsertAsync(BulkInsertInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> BulkInsertAsync(BulkInsertInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1162,9 +1812,35 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task BulkInsertAsync(BulkInsertInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> BulkInsertAsync(BulkInsertInstanceRequest request, st::CancellationToken cancellationToken) => BulkInsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for BulkInsert. + public virtual lro::OperationsClient BulkInsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of BulkInsert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceBulkInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), BulkInsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// BulkInsert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceBulkInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), BulkInsertOperationsClient, callSettings); + /// /// Creates multiple instances. Count specifies the number of instances to create. /// @@ -1179,7 +1855,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation BulkInsert(string project, string zone, BulkInsertInstanceResource bulkInsertInstanceResourceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation BulkInsert(string project, string zone, BulkInsertInstanceResource bulkInsertInstanceResourceResource, gaxgrpc::CallSettings callSettings = null) => BulkInsert(new BulkInsertInstanceRequest { BulkInsertInstanceResourceResource = gax::GaxPreconditions.CheckNotNull(bulkInsertInstanceResourceResource, nameof(bulkInsertInstanceResourceResource)), @@ -1201,7 +1877,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task BulkInsertAsync(string project, string zone, BulkInsertInstanceResource bulkInsertInstanceResourceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> BulkInsertAsync(string project, string zone, BulkInsertInstanceResource bulkInsertInstanceResourceResource, gaxgrpc::CallSettings callSettings = null) => BulkInsertAsync(new BulkInsertInstanceRequest { BulkInsertInstanceResourceResource = gax::GaxPreconditions.CheckNotNull(bulkInsertInstanceResourceResource, nameof(bulkInsertInstanceResourceResource)), @@ -1223,7 +1899,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task BulkInsertAsync(string project, string zone, BulkInsertInstanceResource bulkInsertInstanceResourceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> BulkInsertAsync(string project, string zone, BulkInsertInstanceResource bulkInsertInstanceResourceResource, st::CancellationToken cancellationToken) => BulkInsertAsync(project, zone, bulkInsertInstanceResourceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1232,7 +1908,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1241,7 +1917,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1250,9 +1926,35 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteInstanceRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified Instance resource. For more information, see Deleting an instance. /// @@ -1267,7 +1969,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string zone, string instance, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string zone, string instance, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -1289,7 +1991,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string zone, string instance, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string zone, string instance, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -1311,7 +2013,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string zone, string instance, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string zone, string instance, st::CancellationToken cancellationToken) => DeleteAsync(project, zone, instance, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1320,7 +2022,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DeleteAccessConfig(DeleteAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DeleteAccessConfig(DeleteAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1329,7 +2031,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAccessConfigAsync(DeleteAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAccessConfigAsync(DeleteAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1338,9 +2040,36 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAccessConfigAsync(DeleteAccessConfigInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAccessConfigAsync(DeleteAccessConfigInstanceRequest request, st::CancellationToken cancellationToken) => DeleteAccessConfigAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for DeleteAccessConfig. + public virtual lro::OperationsClient DeleteAccessConfigOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of DeleteAccessConfig + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDeleteAccessConfig(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteAccessConfigOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// DeleteAccessConfig. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAccessConfigAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteAccessConfigOperationsClient, callSettings); + /// /// Deletes an access config from an instance's network interface. /// @@ -1361,7 +2090,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DeleteAccessConfig(string project, string zone, string instance, string accessConfig, string networkInterface, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DeleteAccessConfig(string project, string zone, string instance, string accessConfig, string networkInterface, gaxgrpc::CallSettings callSettings = null) => DeleteAccessConfig(new DeleteAccessConfigInstanceRequest { AccessConfig = gax::GaxPreconditions.CheckNotNullOrEmpty(accessConfig, nameof(accessConfig)), @@ -1391,7 +2120,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAccessConfigAsync(string project, string zone, string instance, string accessConfig, string networkInterface, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAccessConfigAsync(string project, string zone, string instance, string accessConfig, string networkInterface, gaxgrpc::CallSettings callSettings = null) => DeleteAccessConfigAsync(new DeleteAccessConfigInstanceRequest { AccessConfig = gax::GaxPreconditions.CheckNotNullOrEmpty(accessConfig, nameof(accessConfig)), @@ -1421,7 +2150,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAccessConfigAsync(string project, string zone, string instance, string accessConfig, string networkInterface, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAccessConfigAsync(string project, string zone, string instance, string accessConfig, string networkInterface, st::CancellationToken cancellationToken) => DeleteAccessConfigAsync(project, zone, instance, accessConfig, networkInterface, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1430,7 +2159,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DetachDisk(DetachDiskInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DetachDisk(DetachDiskInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1439,7 +2168,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DetachDiskAsync(DetachDiskInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DetachDiskAsync(DetachDiskInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1448,9 +2177,35 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DetachDiskAsync(DetachDiskInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DetachDiskAsync(DetachDiskInstanceRequest request, st::CancellationToken cancellationToken) => DetachDiskAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for DetachDisk. + public virtual lro::OperationsClient DetachDiskOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of DetachDisk. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDetachDisk(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DetachDiskOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// DetachDisk. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDetachDiskAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DetachDiskOperationsClient, callSettings); + /// /// Detaches a disk from an instance. /// @@ -1468,7 +2223,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DetachDisk(string project, string zone, string instance, string deviceName, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DetachDisk(string project, string zone, string instance, string deviceName, gaxgrpc::CallSettings callSettings = null) => DetachDisk(new DetachDiskInstanceRequest { DeviceName = gax::GaxPreconditions.CheckNotNullOrEmpty(deviceName, nameof(deviceName)), @@ -1494,7 +2249,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DetachDiskAsync(string project, string zone, string instance, string deviceName, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DetachDiskAsync(string project, string zone, string instance, string deviceName, gaxgrpc::CallSettings callSettings = null) => DetachDiskAsync(new DetachDiskInstanceRequest { DeviceName = gax::GaxPreconditions.CheckNotNullOrEmpty(deviceName, nameof(deviceName)), @@ -1520,7 +2275,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DetachDiskAsync(string project, string zone, string instance, string deviceName, st::CancellationToken cancellationToken) => + public virtual stt::Task> DetachDiskAsync(string project, string zone, string instance, string deviceName, st::CancellationToken cancellationToken) => DetachDiskAsync(project, zone, instance, deviceName, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -2156,7 +2911,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2165,7 +2920,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2174,9 +2929,35 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertInstanceRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates an instance resource in the specified project using the data included in the request. /// @@ -2191,7 +2972,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string zone, Instance instanceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string zone, Instance instanceResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertInstanceRequest { InstanceResource = gax::GaxPreconditions.CheckNotNull(instanceResource, nameof(instanceResource)), @@ -2213,7 +2994,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string zone, Instance instanceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string zone, Instance instanceResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertInstanceRequest { InstanceResource = gax::GaxPreconditions.CheckNotNull(instanceResource, nameof(instanceResource)), @@ -2235,7 +3016,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string zone, Instance instanceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string zone, Instance instanceResource, st::CancellationToken cancellationToken) => InsertAsync(project, zone, instanceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -2400,7 +3181,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RemoveResourcePolicies(RemoveResourcePoliciesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RemoveResourcePolicies(RemoveResourcePoliciesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2409,7 +3190,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RemoveResourcePoliciesAsync(RemoveResourcePoliciesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RemoveResourcePoliciesAsync(RemoveResourcePoliciesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2418,9 +3199,36 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RemoveResourcePoliciesAsync(RemoveResourcePoliciesInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> RemoveResourcePoliciesAsync(RemoveResourcePoliciesInstanceRequest request, st::CancellationToken cancellationToken) => RemoveResourcePoliciesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for RemoveResourcePolicies. + public virtual lro::OperationsClient RemoveResourcePoliciesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of + /// RemoveResourcePolicies. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceRemoveResourcePolicies(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RemoveResourcePoliciesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// RemoveResourcePolicies. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceRemoveResourcePoliciesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RemoveResourcePoliciesOperationsClient, callSettings); + /// /// Removes resource policies from an instance. /// @@ -2438,7 +3246,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RemoveResourcePolicies(string project, string zone, string instance, InstancesRemoveResourcePoliciesRequest instancesRemoveResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RemoveResourcePolicies(string project, string zone, string instance, InstancesRemoveResourcePoliciesRequest instancesRemoveResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => RemoveResourcePolicies(new RemoveResourcePoliciesInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -2464,7 +3272,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RemoveResourcePoliciesAsync(string project, string zone, string instance, InstancesRemoveResourcePoliciesRequest instancesRemoveResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RemoveResourcePoliciesAsync(string project, string zone, string instance, InstancesRemoveResourcePoliciesRequest instancesRemoveResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => RemoveResourcePoliciesAsync(new RemoveResourcePoliciesInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -2490,7 +3298,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RemoveResourcePoliciesAsync(string project, string zone, string instance, InstancesRemoveResourcePoliciesRequest instancesRemoveResourcePoliciesRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> RemoveResourcePoliciesAsync(string project, string zone, string instance, InstancesRemoveResourcePoliciesRequest instancesRemoveResourcePoliciesRequestResource, st::CancellationToken cancellationToken) => RemoveResourcePoliciesAsync(project, zone, instance, instancesRemoveResourcePoliciesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -2499,7 +3307,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Reset(ResetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Reset(ResetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2508,7 +3316,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task ResetAsync(ResetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> ResetAsync(ResetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2517,9 +3325,35 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task ResetAsync(ResetInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> ResetAsync(ResetInstanceRequest request, st::CancellationToken cancellationToken) => ResetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Reset. + public virtual lro::OperationsClient ResetOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Reset. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceReset(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), ResetOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Reset + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceResetAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), ResetOperationsClient, callSettings); + /// /// Performs a reset on the instance. This is a hard reset the VM does not do a graceful shutdown. For more information, see Resetting an instance. /// @@ -2534,7 +3368,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Reset(string project, string zone, string instance, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Reset(string project, string zone, string instance, gaxgrpc::CallSettings callSettings = null) => Reset(new ResetInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -2556,7 +3390,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task ResetAsync(string project, string zone, string instance, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> ResetAsync(string project, string zone, string instance, gaxgrpc::CallSettings callSettings = null) => ResetAsync(new ResetInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -2578,7 +3412,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task ResetAsync(string project, string zone, string instance, st::CancellationToken cancellationToken) => + public virtual stt::Task> ResetAsync(string project, string zone, string instance, st::CancellationToken cancellationToken) => ResetAsync(project, zone, instance, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -2587,7 +3421,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetDeletionProtection(SetDeletionProtectionInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetDeletionProtection(SetDeletionProtectionInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2596,7 +3430,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetDeletionProtectionAsync(SetDeletionProtectionInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetDeletionProtectionAsync(SetDeletionProtectionInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2605,9 +3439,36 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetDeletionProtectionAsync(SetDeletionProtectionInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetDeletionProtectionAsync(SetDeletionProtectionInstanceRequest request, st::CancellationToken cancellationToken) => SetDeletionProtectionAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetDeletionProtection. + public virtual lro::OperationsClient SetDeletionProtectionOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetDeletionProtection + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetDeletionProtection(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetDeletionProtectionOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetDeletionProtection. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetDeletionProtectionAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetDeletionProtectionOperationsClient, callSettings); + /// /// Sets deletion protection on the instance. /// @@ -2622,7 +3483,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetDeletionProtection(string project, string zone, string resource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetDeletionProtection(string project, string zone, string resource, gaxgrpc::CallSettings callSettings = null) => SetDeletionProtection(new SetDeletionProtectionInstanceRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -2644,7 +3505,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetDeletionProtectionAsync(string project, string zone, string resource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetDeletionProtectionAsync(string project, string zone, string resource, gaxgrpc::CallSettings callSettings = null) => SetDeletionProtectionAsync(new SetDeletionProtectionInstanceRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -2666,7 +3527,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetDeletionProtectionAsync(string project, string zone, string resource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetDeletionProtectionAsync(string project, string zone, string resource, st::CancellationToken cancellationToken) => SetDeletionProtectionAsync(project, zone, resource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -2675,7 +3536,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetDiskAutoDelete(SetDiskAutoDeleteInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetDiskAutoDelete(SetDiskAutoDeleteInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2684,7 +3545,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetDiskAutoDeleteAsync(SetDiskAutoDeleteInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetDiskAutoDeleteAsync(SetDiskAutoDeleteInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2693,9 +3554,36 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetDiskAutoDeleteAsync(SetDiskAutoDeleteInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetDiskAutoDeleteAsync(SetDiskAutoDeleteInstanceRequest request, st::CancellationToken cancellationToken) => SetDiskAutoDeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetDiskAutoDelete. + public virtual lro::OperationsClient SetDiskAutoDeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetDiskAutoDelete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetDiskAutoDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetDiskAutoDeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetDiskAutoDelete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetDiskAutoDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetDiskAutoDeleteOperationsClient, callSettings); + /// /// Sets the auto-delete flag for a disk attached to an instance. /// @@ -2716,7 +3604,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetDiskAutoDelete(string project, string zone, string instance, bool autoDelete, string deviceName, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetDiskAutoDelete(string project, string zone, string instance, bool autoDelete, string deviceName, gaxgrpc::CallSettings callSettings = null) => SetDiskAutoDelete(new SetDiskAutoDeleteInstanceRequest { AutoDelete = autoDelete, @@ -2746,7 +3634,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetDiskAutoDeleteAsync(string project, string zone, string instance, bool autoDelete, string deviceName, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetDiskAutoDeleteAsync(string project, string zone, string instance, bool autoDelete, string deviceName, gaxgrpc::CallSettings callSettings = null) => SetDiskAutoDeleteAsync(new SetDiskAutoDeleteInstanceRequest { AutoDelete = autoDelete, @@ -2776,7 +3664,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetDiskAutoDeleteAsync(string project, string zone, string instance, bool autoDelete, string deviceName, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetDiskAutoDeleteAsync(string project, string zone, string instance, bool autoDelete, string deviceName, st::CancellationToken cancellationToken) => SetDiskAutoDeleteAsync(project, zone, instance, autoDelete, deviceName, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -2884,7 +3772,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetLabels(SetLabelsInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetLabels(SetLabelsInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2893,7 +3781,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(SetLabelsInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetLabelsAsync(SetLabelsInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2902,9 +3790,35 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(SetLabelsInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetLabelsAsync(SetLabelsInstanceRequest request, st::CancellationToken cancellationToken) => SetLabelsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetLabels. + public virtual lro::OperationsClient SetLabelsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetLabels. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetLabels(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetLabelsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetLabels. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetLabelsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetLabelsOperationsClient, callSettings); + /// /// Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. /// @@ -2922,7 +3836,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetLabels(string project, string zone, string instance, InstancesSetLabelsRequest instancesSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetLabels(string project, string zone, string instance, InstancesSetLabelsRequest instancesSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetLabels(new SetLabelsInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -2948,7 +3862,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(string project, string zone, string instance, InstancesSetLabelsRequest instancesSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetLabelsAsync(string project, string zone, string instance, InstancesSetLabelsRequest instancesSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetLabelsAsync(new SetLabelsInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -2974,7 +3888,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(string project, string zone, string instance, InstancesSetLabelsRequest instancesSetLabelsRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetLabelsAsync(string project, string zone, string instance, InstancesSetLabelsRequest instancesSetLabelsRequestResource, st::CancellationToken cancellationToken) => SetLabelsAsync(project, zone, instance, instancesSetLabelsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -2983,7 +3897,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetMachineResources(SetMachineResourcesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetMachineResources(SetMachineResourcesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2992,7 +3906,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetMachineResourcesAsync(SetMachineResourcesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetMachineResourcesAsync(SetMachineResourcesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -3001,9 +3915,36 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetMachineResourcesAsync(SetMachineResourcesInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetMachineResourcesAsync(SetMachineResourcesInstanceRequest request, st::CancellationToken cancellationToken) => SetMachineResourcesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetMachineResources. + public virtual lro::OperationsClient SetMachineResourcesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetMachineResources + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetMachineResources(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetMachineResourcesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetMachineResources. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetMachineResourcesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetMachineResourcesOperationsClient, callSettings); + /// /// Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. /// @@ -3021,7 +3962,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetMachineResources(string project, string zone, string instance, InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetMachineResources(string project, string zone, string instance, InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource, gaxgrpc::CallSettings callSettings = null) => SetMachineResources(new SetMachineResourcesInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -3047,7 +3988,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetMachineResourcesAsync(string project, string zone, string instance, InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetMachineResourcesAsync(string project, string zone, string instance, InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource, gaxgrpc::CallSettings callSettings = null) => SetMachineResourcesAsync(new SetMachineResourcesInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -3073,7 +4014,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetMachineResourcesAsync(string project, string zone, string instance, InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetMachineResourcesAsync(string project, string zone, string instance, InstancesSetMachineResourcesRequest instancesSetMachineResourcesRequestResource, st::CancellationToken cancellationToken) => SetMachineResourcesAsync(project, zone, instance, instancesSetMachineResourcesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -3082,7 +4023,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetMachineType(SetMachineTypeInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetMachineType(SetMachineTypeInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -3091,7 +4032,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetMachineTypeAsync(SetMachineTypeInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetMachineTypeAsync(SetMachineTypeInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -3100,9 +4041,35 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetMachineTypeAsync(SetMachineTypeInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetMachineTypeAsync(SetMachineTypeInstanceRequest request, st::CancellationToken cancellationToken) => SetMachineTypeAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetMachineType. + public virtual lro::OperationsClient SetMachineTypeOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetMachineType. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetMachineType(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetMachineTypeOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetMachineType. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetMachineTypeAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetMachineTypeOperationsClient, callSettings); + /// /// Changes the machine type for a stopped instance to the machine type specified in the request. /// @@ -3120,7 +4087,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetMachineType(string project, string zone, string instance, InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetMachineType(string project, string zone, string instance, InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource, gaxgrpc::CallSettings callSettings = null) => SetMachineType(new SetMachineTypeInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -3146,7 +4113,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetMachineTypeAsync(string project, string zone, string instance, InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetMachineTypeAsync(string project, string zone, string instance, InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource, gaxgrpc::CallSettings callSettings = null) => SetMachineTypeAsync(new SetMachineTypeInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -3172,7 +4139,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetMachineTypeAsync(string project, string zone, string instance, InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetMachineTypeAsync(string project, string zone, string instance, InstancesSetMachineTypeRequest instancesSetMachineTypeRequestResource, st::CancellationToken cancellationToken) => SetMachineTypeAsync(project, zone, instance, instancesSetMachineTypeRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -3181,7 +4148,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetMetadata(SetMetadataInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetMetadata(SetMetadataInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -3190,7 +4157,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetMetadataAsync(SetMetadataInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetMetadataAsync(SetMetadataInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -3199,9 +4166,35 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetMetadataAsync(SetMetadataInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetMetadataAsync(SetMetadataInstanceRequest request, st::CancellationToken cancellationToken) => SetMetadataAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetMetadata. + public virtual lro::OperationsClient SetMetadataOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetMetadata. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetMetadata(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetMetadataOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetMetadata. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetMetadataAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetMetadataOperationsClient, callSettings); + /// /// Sets metadata for the specified instance to the data included in the request. /// @@ -3219,7 +4212,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetMetadata(string project, string zone, string instance, Metadata metadataResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetMetadata(string project, string zone, string instance, Metadata metadataResource, gaxgrpc::CallSettings callSettings = null) => SetMetadata(new SetMetadataInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -3245,7 +4238,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetMetadataAsync(string project, string zone, string instance, Metadata metadataResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetMetadataAsync(string project, string zone, string instance, Metadata metadataResource, gaxgrpc::CallSettings callSettings = null) => SetMetadataAsync(new SetMetadataInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -3271,7 +4264,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetMetadataAsync(string project, string zone, string instance, Metadata metadataResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetMetadataAsync(string project, string zone, string instance, Metadata metadataResource, st::CancellationToken cancellationToken) => SetMetadataAsync(project, zone, instance, metadataResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -3280,7 +4273,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetMinCpuPlatform(SetMinCpuPlatformInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetMinCpuPlatform(SetMinCpuPlatformInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -3289,7 +4282,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetMinCpuPlatformAsync(SetMinCpuPlatformInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetMinCpuPlatformAsync(SetMinCpuPlatformInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -3298,9 +4291,36 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetMinCpuPlatformAsync(SetMinCpuPlatformInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetMinCpuPlatformAsync(SetMinCpuPlatformInstanceRequest request, st::CancellationToken cancellationToken) => SetMinCpuPlatformAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetMinCpuPlatform. + public virtual lro::OperationsClient SetMinCpuPlatformOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetMinCpuPlatform + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetMinCpuPlatform(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetMinCpuPlatformOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetMinCpuPlatform. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetMinCpuPlatformAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetMinCpuPlatformOperationsClient, callSettings); + /// /// Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform. /// @@ -3318,7 +4338,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetMinCpuPlatform(string project, string zone, string instance, InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetMinCpuPlatform(string project, string zone, string instance, InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource, gaxgrpc::CallSettings callSettings = null) => SetMinCpuPlatform(new SetMinCpuPlatformInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -3344,7 +4364,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetMinCpuPlatformAsync(string project, string zone, string instance, InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetMinCpuPlatformAsync(string project, string zone, string instance, InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource, gaxgrpc::CallSettings callSettings = null) => SetMinCpuPlatformAsync(new SetMinCpuPlatformInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -3370,7 +4390,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetMinCpuPlatformAsync(string project, string zone, string instance, InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetMinCpuPlatformAsync(string project, string zone, string instance, InstancesSetMinCpuPlatformRequest instancesSetMinCpuPlatformRequestResource, st::CancellationToken cancellationToken) => SetMinCpuPlatformAsync(project, zone, instance, instancesSetMinCpuPlatformRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -3379,7 +4399,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetScheduling(SetSchedulingInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetScheduling(SetSchedulingInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -3388,7 +4408,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetSchedulingAsync(SetSchedulingInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetSchedulingAsync(SetSchedulingInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -3397,9 +4417,35 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetSchedulingAsync(SetSchedulingInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetSchedulingAsync(SetSchedulingInstanceRequest request, st::CancellationToken cancellationToken) => SetSchedulingAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetScheduling. + public virtual lro::OperationsClient SetSchedulingOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetScheduling. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetScheduling(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetSchedulingOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetScheduling. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetSchedulingAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetSchedulingOperationsClient, callSettings); + /// /// Sets an instance's scheduling options. You can only call this method on a stopped instance, that is, a VM instance that is in a `TERMINATED` state. See Instance Life Cycle for more information on the possible instance states. /// @@ -3417,7 +4463,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetScheduling(string project, string zone, string instance, Scheduling schedulingResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetScheduling(string project, string zone, string instance, Scheduling schedulingResource, gaxgrpc::CallSettings callSettings = null) => SetScheduling(new SetSchedulingInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -3443,7 +4489,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetSchedulingAsync(string project, string zone, string instance, Scheduling schedulingResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetSchedulingAsync(string project, string zone, string instance, Scheduling schedulingResource, gaxgrpc::CallSettings callSettings = null) => SetSchedulingAsync(new SetSchedulingInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -3469,7 +4515,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetSchedulingAsync(string project, string zone, string instance, Scheduling schedulingResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetSchedulingAsync(string project, string zone, string instance, Scheduling schedulingResource, st::CancellationToken cancellationToken) => SetSchedulingAsync(project, zone, instance, schedulingResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -3478,7 +4524,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetServiceAccount(SetServiceAccountInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetServiceAccount(SetServiceAccountInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -3487,7 +4533,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetServiceAccountAsync(SetServiceAccountInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetServiceAccountAsync(SetServiceAccountInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -3496,9 +4542,36 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetServiceAccountAsync(SetServiceAccountInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetServiceAccountAsync(SetServiceAccountInstanceRequest request, st::CancellationToken cancellationToken) => SetServiceAccountAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetServiceAccount. + public virtual lro::OperationsClient SetServiceAccountOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetServiceAccount + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetServiceAccount(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetServiceAccountOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetServiceAccount. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetServiceAccountAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetServiceAccountOperationsClient, callSettings); + /// /// Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance. /// @@ -3516,7 +4589,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetServiceAccount(string project, string zone, string instance, InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetServiceAccount(string project, string zone, string instance, InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource, gaxgrpc::CallSettings callSettings = null) => SetServiceAccount(new SetServiceAccountInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -3542,7 +4615,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetServiceAccountAsync(string project, string zone, string instance, InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetServiceAccountAsync(string project, string zone, string instance, InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource, gaxgrpc::CallSettings callSettings = null) => SetServiceAccountAsync(new SetServiceAccountInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -3568,7 +4641,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetServiceAccountAsync(string project, string zone, string instance, InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetServiceAccountAsync(string project, string zone, string instance, InstancesSetServiceAccountRequest instancesSetServiceAccountRequestResource, st::CancellationToken cancellationToken) => SetServiceAccountAsync(project, zone, instance, instancesSetServiceAccountRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -3577,7 +4650,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetShieldedInstanceIntegrityPolicy(SetShieldedInstanceIntegrityPolicyInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetShieldedInstanceIntegrityPolicy(SetShieldedInstanceIntegrityPolicyInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -3586,7 +4659,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetShieldedInstanceIntegrityPolicyAsync(SetShieldedInstanceIntegrityPolicyInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetShieldedInstanceIntegrityPolicyAsync(SetShieldedInstanceIntegrityPolicyInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -3595,9 +4668,36 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetShieldedInstanceIntegrityPolicyAsync(SetShieldedInstanceIntegrityPolicyInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetShieldedInstanceIntegrityPolicyAsync(SetShieldedInstanceIntegrityPolicyInstanceRequest request, st::CancellationToken cancellationToken) => SetShieldedInstanceIntegrityPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetShieldedInstanceIntegrityPolicy. + public virtual lro::OperationsClient SetShieldedInstanceIntegrityPolicyOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of + /// SetShieldedInstanceIntegrityPolicy. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetShieldedInstanceIntegrityPolicy(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetShieldedInstanceIntegrityPolicyOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetShieldedInstanceIntegrityPolicy. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetShieldedInstanceIntegrityPolicyAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetShieldedInstanceIntegrityPolicyOperationsClient, callSettings); + /// /// Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// @@ -3615,7 +4715,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetShieldedInstanceIntegrityPolicy(string project, string zone, string instance, ShieldedInstanceIntegrityPolicy shieldedInstanceIntegrityPolicyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetShieldedInstanceIntegrityPolicy(string project, string zone, string instance, ShieldedInstanceIntegrityPolicy shieldedInstanceIntegrityPolicyResource, gaxgrpc::CallSettings callSettings = null) => SetShieldedInstanceIntegrityPolicy(new SetShieldedInstanceIntegrityPolicyInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -3641,7 +4741,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetShieldedInstanceIntegrityPolicyAsync(string project, string zone, string instance, ShieldedInstanceIntegrityPolicy shieldedInstanceIntegrityPolicyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetShieldedInstanceIntegrityPolicyAsync(string project, string zone, string instance, ShieldedInstanceIntegrityPolicy shieldedInstanceIntegrityPolicyResource, gaxgrpc::CallSettings callSettings = null) => SetShieldedInstanceIntegrityPolicyAsync(new SetShieldedInstanceIntegrityPolicyInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -3667,7 +4767,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetShieldedInstanceIntegrityPolicyAsync(string project, string zone, string instance, ShieldedInstanceIntegrityPolicy shieldedInstanceIntegrityPolicyResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetShieldedInstanceIntegrityPolicyAsync(string project, string zone, string instance, ShieldedInstanceIntegrityPolicy shieldedInstanceIntegrityPolicyResource, st::CancellationToken cancellationToken) => SetShieldedInstanceIntegrityPolicyAsync(project, zone, instance, shieldedInstanceIntegrityPolicyResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -3676,7 +4776,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetTags(SetTagsInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetTags(SetTagsInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -3685,7 +4785,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetTagsAsync(SetTagsInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetTagsAsync(SetTagsInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -3694,9 +4794,35 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetTagsAsync(SetTagsInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetTagsAsync(SetTagsInstanceRequest request, st::CancellationToken cancellationToken) => SetTagsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetTags. + public virtual lro::OperationsClient SetTagsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetTags. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetTags(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetTagsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetTags. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetTagsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetTagsOperationsClient, callSettings); + /// /// Sets network tags for the specified instance to the data included in the request. /// @@ -3714,7 +4840,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetTags(string project, string zone, string instance, Tags tagsResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetTags(string project, string zone, string instance, Tags tagsResource, gaxgrpc::CallSettings callSettings = null) => SetTags(new SetTagsInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -3740,7 +4866,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetTagsAsync(string project, string zone, string instance, Tags tagsResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetTagsAsync(string project, string zone, string instance, Tags tagsResource, gaxgrpc::CallSettings callSettings = null) => SetTagsAsync(new SetTagsInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -3766,7 +4892,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetTagsAsync(string project, string zone, string instance, Tags tagsResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetTagsAsync(string project, string zone, string instance, Tags tagsResource, st::CancellationToken cancellationToken) => SetTagsAsync(project, zone, instance, tagsResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -3775,7 +4901,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SimulateMaintenanceEvent(SimulateMaintenanceEventInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SimulateMaintenanceEvent(SimulateMaintenanceEventInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -3784,7 +4910,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SimulateMaintenanceEventAsync(SimulateMaintenanceEventInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SimulateMaintenanceEventAsync(SimulateMaintenanceEventInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -3793,9 +4919,36 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SimulateMaintenanceEventAsync(SimulateMaintenanceEventInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SimulateMaintenanceEventAsync(SimulateMaintenanceEventInstanceRequest request, st::CancellationToken cancellationToken) => SimulateMaintenanceEventAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SimulateMaintenanceEvent. + public virtual lro::OperationsClient SimulateMaintenanceEventOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of + /// SimulateMaintenanceEvent. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSimulateMaintenanceEvent(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SimulateMaintenanceEventOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SimulateMaintenanceEvent. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSimulateMaintenanceEventAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SimulateMaintenanceEventOperationsClient, callSettings); + /// /// Simulates a maintenance event on the instance. /// @@ -3810,7 +4963,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SimulateMaintenanceEvent(string project, string zone, string instance, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SimulateMaintenanceEvent(string project, string zone, string instance, gaxgrpc::CallSettings callSettings = null) => SimulateMaintenanceEvent(new SimulateMaintenanceEventInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -3832,7 +4985,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SimulateMaintenanceEventAsync(string project, string zone, string instance, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SimulateMaintenanceEventAsync(string project, string zone, string instance, gaxgrpc::CallSettings callSettings = null) => SimulateMaintenanceEventAsync(new SimulateMaintenanceEventInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -3854,7 +5007,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SimulateMaintenanceEventAsync(string project, string zone, string instance, st::CancellationToken cancellationToken) => + public virtual stt::Task> SimulateMaintenanceEventAsync(string project, string zone, string instance, st::CancellationToken cancellationToken) => SimulateMaintenanceEventAsync(project, zone, instance, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -3863,7 +5016,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Start(StartInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Start(StartInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -3872,7 +5025,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task StartAsync(StartInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> StartAsync(StartInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -3881,9 +5034,35 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task StartAsync(StartInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> StartAsync(StartInstanceRequest request, st::CancellationToken cancellationToken) => StartAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Start. + public virtual lro::OperationsClient StartOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Start. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceStart(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), StartOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Start + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceStartAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), StartOperationsClient, callSettings); + /// /// Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. /// @@ -3898,7 +5077,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Start(string project, string zone, string instance, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Start(string project, string zone, string instance, gaxgrpc::CallSettings callSettings = null) => Start(new StartInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -3920,7 +5099,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task StartAsync(string project, string zone, string instance, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> StartAsync(string project, string zone, string instance, gaxgrpc::CallSettings callSettings = null) => StartAsync(new StartInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -3942,7 +5121,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task StartAsync(string project, string zone, string instance, st::CancellationToken cancellationToken) => + public virtual stt::Task> StartAsync(string project, string zone, string instance, st::CancellationToken cancellationToken) => StartAsync(project, zone, instance, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -3951,7 +5130,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation StartWithEncryptionKey(StartWithEncryptionKeyInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation StartWithEncryptionKey(StartWithEncryptionKeyInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -3960,7 +5139,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task StartWithEncryptionKeyAsync(StartWithEncryptionKeyInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> StartWithEncryptionKeyAsync(StartWithEncryptionKeyInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -3969,9 +5148,36 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task StartWithEncryptionKeyAsync(StartWithEncryptionKeyInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> StartWithEncryptionKeyAsync(StartWithEncryptionKeyInstanceRequest request, st::CancellationToken cancellationToken) => StartWithEncryptionKeyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for StartWithEncryptionKey. + public virtual lro::OperationsClient StartWithEncryptionKeyOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of + /// StartWithEncryptionKey. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceStartWithEncryptionKey(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), StartWithEncryptionKeyOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// StartWithEncryptionKey. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceStartWithEncryptionKeyAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), StartWithEncryptionKeyOperationsClient, callSettings); + /// /// Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. /// @@ -3989,7 +5195,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation StartWithEncryptionKey(string project, string zone, string instance, InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation StartWithEncryptionKey(string project, string zone, string instance, InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource, gaxgrpc::CallSettings callSettings = null) => StartWithEncryptionKey(new StartWithEncryptionKeyInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -4015,7 +5221,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task StartWithEncryptionKeyAsync(string project, string zone, string instance, InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> StartWithEncryptionKeyAsync(string project, string zone, string instance, InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource, gaxgrpc::CallSettings callSettings = null) => StartWithEncryptionKeyAsync(new StartWithEncryptionKeyInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -4041,7 +5247,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task StartWithEncryptionKeyAsync(string project, string zone, string instance, InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> StartWithEncryptionKeyAsync(string project, string zone, string instance, InstancesStartWithEncryptionKeyRequest instancesStartWithEncryptionKeyRequestResource, st::CancellationToken cancellationToken) => StartWithEncryptionKeyAsync(project, zone, instance, instancesStartWithEncryptionKeyRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -4050,7 +5256,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Stop(StopInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Stop(StopInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -4059,7 +5265,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task StopAsync(StopInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> StopAsync(StopInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -4068,9 +5274,35 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task StopAsync(StopInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> StopAsync(StopInstanceRequest request, st::CancellationToken cancellationToken) => StopAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Stop. + public virtual lro::OperationsClient StopOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Stop. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceStop(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), StopOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Stop + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceStopAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), StopOperationsClient, callSettings); + /// /// Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. /// @@ -4085,7 +5317,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Stop(string project, string zone, string instance, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Stop(string project, string zone, string instance, gaxgrpc::CallSettings callSettings = null) => Stop(new StopInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -4107,7 +5339,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task StopAsync(string project, string zone, string instance, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> StopAsync(string project, string zone, string instance, gaxgrpc::CallSettings callSettings = null) => StopAsync(new StopInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -4129,7 +5361,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task StopAsync(string project, string zone, string instance, st::CancellationToken cancellationToken) => + public virtual stt::Task> StopAsync(string project, string zone, string instance, st::CancellationToken cancellationToken) => StopAsync(project, zone, instance, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -4237,7 +5469,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(UpdateInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(UpdateInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -4246,7 +5478,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(UpdateInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -4255,9 +5487,35 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(UpdateInstanceRequest request, st::CancellationToken cancellationToken) => UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Update. + public virtual lro::OperationsClient UpdateOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Update. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceUpdate(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Update + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceUpdateAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + /// /// Updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties. /// @@ -4275,7 +5533,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(string project, string zone, string instance, Instance instanceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(string project, string zone, string instance, Instance instanceResource, gaxgrpc::CallSettings callSettings = null) => Update(new UpdateInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -4301,7 +5559,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string zone, string instance, Instance instanceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(string project, string zone, string instance, Instance instanceResource, gaxgrpc::CallSettings callSettings = null) => UpdateAsync(new UpdateInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -4327,7 +5585,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string zone, string instance, Instance instanceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(string project, string zone, string instance, Instance instanceResource, st::CancellationToken cancellationToken) => UpdateAsync(project, zone, instance, instanceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -4336,7 +5594,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation UpdateAccessConfig(UpdateAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation UpdateAccessConfig(UpdateAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -4345,7 +5603,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAccessConfigAsync(UpdateAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAccessConfigAsync(UpdateAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -4354,9 +5612,36 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAccessConfigAsync(UpdateAccessConfigInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAccessConfigAsync(UpdateAccessConfigInstanceRequest request, st::CancellationToken cancellationToken) => UpdateAccessConfigAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for UpdateAccessConfig. + public virtual lro::OperationsClient UpdateAccessConfigOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of UpdateAccessConfig + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceUpdateAccessConfig(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateAccessConfigOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// UpdateAccessConfig. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceUpdateAccessConfigAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateAccessConfigOperationsClient, callSettings); + /// /// Updates the specified access config from an instance's network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// @@ -4377,7 +5662,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation UpdateAccessConfig(string project, string zone, string instance, string networkInterface, AccessConfig accessConfigResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation UpdateAccessConfig(string project, string zone, string instance, string networkInterface, AccessConfig accessConfigResource, gaxgrpc::CallSettings callSettings = null) => UpdateAccessConfig(new UpdateAccessConfigInstanceRequest { AccessConfigResource = gax::GaxPreconditions.CheckNotNull(accessConfigResource, nameof(accessConfigResource)), @@ -4407,7 +5692,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAccessConfigAsync(string project, string zone, string instance, string networkInterface, AccessConfig accessConfigResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAccessConfigAsync(string project, string zone, string instance, string networkInterface, AccessConfig accessConfigResource, gaxgrpc::CallSettings callSettings = null) => UpdateAccessConfigAsync(new UpdateAccessConfigInstanceRequest { AccessConfigResource = gax::GaxPreconditions.CheckNotNull(accessConfigResource, nameof(accessConfigResource)), @@ -4437,7 +5722,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAccessConfigAsync(string project, string zone, string instance, string networkInterface, AccessConfig accessConfigResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAccessConfigAsync(string project, string zone, string instance, string networkInterface, AccessConfig accessConfigResource, st::CancellationToken cancellationToken) => UpdateAccessConfigAsync(project, zone, instance, networkInterface, accessConfigResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -4446,7 +5731,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation UpdateDisplayDevice(UpdateDisplayDeviceInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation UpdateDisplayDevice(UpdateDisplayDeviceInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -4455,7 +5740,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateDisplayDeviceAsync(UpdateDisplayDeviceInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateDisplayDeviceAsync(UpdateDisplayDeviceInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -4464,9 +5749,36 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateDisplayDeviceAsync(UpdateDisplayDeviceInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateDisplayDeviceAsync(UpdateDisplayDeviceInstanceRequest request, st::CancellationToken cancellationToken) => UpdateDisplayDeviceAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for UpdateDisplayDevice. + public virtual lro::OperationsClient UpdateDisplayDeviceOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of UpdateDisplayDevice + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceUpdateDisplayDevice(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateDisplayDeviceOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// UpdateDisplayDevice. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceUpdateDisplayDeviceAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateDisplayDeviceOperationsClient, callSettings); + /// /// Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// @@ -4484,7 +5796,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation UpdateDisplayDevice(string project, string zone, string instance, DisplayDevice displayDeviceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation UpdateDisplayDevice(string project, string zone, string instance, DisplayDevice displayDeviceResource, gaxgrpc::CallSettings callSettings = null) => UpdateDisplayDevice(new UpdateDisplayDeviceInstanceRequest { DisplayDeviceResource = gax::GaxPreconditions.CheckNotNull(displayDeviceResource, nameof(displayDeviceResource)), @@ -4510,7 +5822,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateDisplayDeviceAsync(string project, string zone, string instance, DisplayDevice displayDeviceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateDisplayDeviceAsync(string project, string zone, string instance, DisplayDevice displayDeviceResource, gaxgrpc::CallSettings callSettings = null) => UpdateDisplayDeviceAsync(new UpdateDisplayDeviceInstanceRequest { DisplayDeviceResource = gax::GaxPreconditions.CheckNotNull(displayDeviceResource, nameof(displayDeviceResource)), @@ -4536,7 +5848,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateDisplayDeviceAsync(string project, string zone, string instance, DisplayDevice displayDeviceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateDisplayDeviceAsync(string project, string zone, string instance, DisplayDevice displayDeviceResource, st::CancellationToken cancellationToken) => UpdateDisplayDeviceAsync(project, zone, instance, displayDeviceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -4545,7 +5857,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation UpdateNetworkInterface(UpdateNetworkInterfaceInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation UpdateNetworkInterface(UpdateNetworkInterfaceInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -4554,7 +5866,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateNetworkInterfaceAsync(UpdateNetworkInterfaceInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateNetworkInterfaceAsync(UpdateNetworkInterfaceInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -4563,9 +5875,36 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateNetworkInterfaceAsync(UpdateNetworkInterfaceInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateNetworkInterfaceAsync(UpdateNetworkInterfaceInstanceRequest request, st::CancellationToken cancellationToken) => UpdateNetworkInterfaceAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for UpdateNetworkInterface. + public virtual lro::OperationsClient UpdateNetworkInterfaceOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of + /// UpdateNetworkInterface. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceUpdateNetworkInterface(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateNetworkInterfaceOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// UpdateNetworkInterface. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceUpdateNetworkInterfaceAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateNetworkInterfaceOperationsClient, callSettings); + /// /// Updates an instance's network interface. This method can only update an interface's alias IP range and attached network. See Modifying alias IP ranges for an existing instance for instructions on changing alias IP ranges. See Migrating a VM between networks for instructions on migrating an interface. This method follows PATCH semantics. /// @@ -4586,7 +5925,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation UpdateNetworkInterface(string project, string zone, string instance, string networkInterface, NetworkInterface networkInterfaceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation UpdateNetworkInterface(string project, string zone, string instance, string networkInterface, NetworkInterface networkInterfaceResource, gaxgrpc::CallSettings callSettings = null) => UpdateNetworkInterface(new UpdateNetworkInterfaceInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -4616,7 +5955,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateNetworkInterfaceAsync(string project, string zone, string instance, string networkInterface, NetworkInterface networkInterfaceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateNetworkInterfaceAsync(string project, string zone, string instance, string networkInterface, NetworkInterface networkInterfaceResource, gaxgrpc::CallSettings callSettings = null) => UpdateNetworkInterfaceAsync(new UpdateNetworkInterfaceInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -4646,7 +5985,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateNetworkInterfaceAsync(string project, string zone, string instance, string networkInterface, NetworkInterface networkInterfaceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateNetworkInterfaceAsync(string project, string zone, string instance, string networkInterface, NetworkInterface networkInterfaceResource, st::CancellationToken cancellationToken) => UpdateNetworkInterfaceAsync(project, zone, instance, networkInterface, networkInterfaceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -4655,7 +5994,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation UpdateShieldedInstanceConfig(UpdateShieldedInstanceConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation UpdateShieldedInstanceConfig(UpdateShieldedInstanceConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -4664,7 +6003,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateShieldedInstanceConfigAsync(UpdateShieldedInstanceConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateShieldedInstanceConfigAsync(UpdateShieldedInstanceConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -4673,9 +6012,36 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateShieldedInstanceConfigAsync(UpdateShieldedInstanceConfigInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateShieldedInstanceConfigAsync(UpdateShieldedInstanceConfigInstanceRequest request, st::CancellationToken cancellationToken) => UpdateShieldedInstanceConfigAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for UpdateShieldedInstanceConfig. + public virtual lro::OperationsClient UpdateShieldedInstanceConfigOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of + /// UpdateShieldedInstanceConfig. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceUpdateShieldedInstanceConfig(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateShieldedInstanceConfigOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// UpdateShieldedInstanceConfig. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceUpdateShieldedInstanceConfigAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateShieldedInstanceConfigOperationsClient, callSettings); + /// /// Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// @@ -4693,7 +6059,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation UpdateShieldedInstanceConfig(string project, string zone, string instance, ShieldedInstanceConfig shieldedInstanceConfigResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation UpdateShieldedInstanceConfig(string project, string zone, string instance, ShieldedInstanceConfig shieldedInstanceConfigResource, gaxgrpc::CallSettings callSettings = null) => UpdateShieldedInstanceConfig(new UpdateShieldedInstanceConfigInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -4719,7 +6085,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateShieldedInstanceConfigAsync(string project, string zone, string instance, ShieldedInstanceConfig shieldedInstanceConfigResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateShieldedInstanceConfigAsync(string project, string zone, string instance, ShieldedInstanceConfig shieldedInstanceConfigResource, gaxgrpc::CallSettings callSettings = null) => UpdateShieldedInstanceConfigAsync(new UpdateShieldedInstanceConfigInstanceRequest { Instance = gax::GaxPreconditions.CheckNotNullOrEmpty(instance, nameof(instance)), @@ -4745,7 +6111,7 @@ internal static InstancesClient Create(grpccore::CallInvoker callInvoker, Instan /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateShieldedInstanceConfigAsync(string project, string zone, string instance, ShieldedInstanceConfig shieldedInstanceConfigResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateShieldedInstanceConfigAsync(string project, string zone, string instance, ShieldedInstanceConfig shieldedInstanceConfigResource, st::CancellationToken cancellationToken) => UpdateShieldedInstanceConfigAsync(project, zone, instance, shieldedInstanceConfigResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -4849,6 +6215,36 @@ public InstancesClientImpl(Instances.InstancesClient grpcClient, InstancesSettin GrpcClient = grpcClient; InstancesSettings effectiveSettings = settings ?? InstancesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + AddAccessConfigOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.AddAccessConfigOperationsSettings); + AddResourcePoliciesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.AddResourcePoliciesOperationsSettings); + AttachDiskOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.AttachDiskOperationsSettings); + BulkInsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.BulkInsertOperationsSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.DeleteOperationsSettings); + DeleteAccessConfigOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.DeleteAccessConfigOperationsSettings); + DetachDiskOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.DetachDiskOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.InsertOperationsSettings); + RemoveResourcePoliciesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.RemoveResourcePoliciesOperationsSettings); + ResetOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.ResetOperationsSettings); + SetDeletionProtectionOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.SetDeletionProtectionOperationsSettings); + SetDiskAutoDeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.SetDiskAutoDeleteOperationsSettings); + SetLabelsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.SetLabelsOperationsSettings); + SetMachineResourcesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.SetMachineResourcesOperationsSettings); + SetMachineTypeOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.SetMachineTypeOperationsSettings); + SetMetadataOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.SetMetadataOperationsSettings); + SetMinCpuPlatformOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.SetMinCpuPlatformOperationsSettings); + SetSchedulingOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.SetSchedulingOperationsSettings); + SetServiceAccountOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.SetServiceAccountOperationsSettings); + SetShieldedInstanceIntegrityPolicyOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.SetShieldedInstanceIntegrityPolicyOperationsSettings); + SetTagsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.SetTagsOperationsSettings); + SimulateMaintenanceEventOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.SimulateMaintenanceEventOperationsSettings); + StartOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.StartOperationsSettings); + StartWithEncryptionKeyOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.StartWithEncryptionKeyOperationsSettings); + StopOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.StopOperationsSettings); + UpdateOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.UpdateOperationsSettings); + UpdateAccessConfigOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.UpdateAccessConfigOperationsSettings); + UpdateDisplayDeviceOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.UpdateDisplayDeviceOperationsSettings); + UpdateNetworkInterfaceOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.UpdateNetworkInterfaceOperationsSettings); + UpdateShieldedInstanceConfigOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.UpdateShieldedInstanceConfigOperationsSettings); _callAddAccessConfig = clientHelper.BuildApiCall(grpcClient.AddAccessConfigAsync, grpcClient.AddAccessConfig, effectiveSettings.AddAccessConfigSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("zone", request => request.Zone).WithGoogleRequestParam("instance", request => request.Instance); Modify_ApiCall(ref _callAddAccessConfig); Modify_AddAccessConfigApiCall(ref _callAddAccessConfig); @@ -5153,16 +6549,22 @@ public InstancesClientImpl(Instances.InstancesClient grpcClient, InstancesSettin partial void Modify_UpdateShieldedInstanceConfigInstanceRequest(ref UpdateShieldedInstanceConfigInstanceRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for AddAccessConfig. + public override lro::OperationsClient AddAccessConfigOperationsClient { get; } + /// /// Adds an access config to an instance's network interface. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation AddAccessConfig(AddAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation AddAccessConfig(AddAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddAccessConfigInstanceRequest(ref request, ref callSettings); - return _callAddAccessConfig.Sync(request, callSettings); + Operation response = _callAddAccessConfig.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddAccessConfigOperationsClient); } /// @@ -5171,22 +6573,31 @@ public override Operation AddAccessConfig(AddAccessConfigInstanceRequest request /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task AddAccessConfigAsync(AddAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> AddAccessConfigAsync(AddAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddAccessConfigInstanceRequest(ref request, ref callSettings); - return _callAddAccessConfig.Async(request, callSettings); + Operation response = await _callAddAccessConfig.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddAccessConfigOperationsClient); } + /// The long-running operations client for AddResourcePolicies. + public override lro::OperationsClient AddResourcePoliciesOperationsClient { get; } + /// /// Adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation AddResourcePolicies(AddResourcePoliciesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation AddResourcePolicies(AddResourcePoliciesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddResourcePoliciesInstanceRequest(ref request, ref callSettings); - return _callAddResourcePolicies.Sync(request, callSettings); + Operation response = _callAddResourcePolicies.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddResourcePoliciesOperationsClient); } /// @@ -5195,10 +6606,13 @@ public override Operation AddResourcePolicies(AddResourcePoliciesInstanceRequest /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task AddResourcePoliciesAsync(AddResourcePoliciesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> AddResourcePoliciesAsync(AddResourcePoliciesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddResourcePoliciesInstanceRequest(ref request, ref callSettings); - return _callAddResourcePolicies.Async(request, callSettings); + Operation response = await _callAddResourcePolicies.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddResourcePoliciesOperationsClient); } /// @@ -5227,16 +6641,22 @@ public override Operation AddResourcePolicies(AddResourcePoliciesInstanceRequest return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for AttachDisk. + public override lro::OperationsClient AttachDiskOperationsClient { get; } + /// /// Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation AttachDisk(AttachDiskInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation AttachDisk(AttachDiskInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AttachDiskInstanceRequest(ref request, ref callSettings); - return _callAttachDisk.Sync(request, callSettings); + Operation response = _callAttachDisk.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AttachDiskOperationsClient); } /// @@ -5245,22 +6665,31 @@ public override Operation AttachDisk(AttachDiskInstanceRequest request, gaxgrpc: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task AttachDiskAsync(AttachDiskInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> AttachDiskAsync(AttachDiskInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AttachDiskInstanceRequest(ref request, ref callSettings); - return _callAttachDisk.Async(request, callSettings); + Operation response = await _callAttachDisk.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AttachDiskOperationsClient); } + /// The long-running operations client for BulkInsert. + public override lro::OperationsClient BulkInsertOperationsClient { get; } + /// /// Creates multiple instances. Count specifies the number of instances to create. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation BulkInsert(BulkInsertInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation BulkInsert(BulkInsertInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_BulkInsertInstanceRequest(ref request, ref callSettings); - return _callBulkInsert.Sync(request, callSettings); + Operation response = _callBulkInsert.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), BulkInsertOperationsClient); } /// @@ -5269,22 +6698,31 @@ public override Operation BulkInsert(BulkInsertInstanceRequest request, gaxgrpc: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task BulkInsertAsync(BulkInsertInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> BulkInsertAsync(BulkInsertInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_BulkInsertInstanceRequest(ref request, ref callSettings); - return _callBulkInsert.Async(request, callSettings); + Operation response = await _callBulkInsert.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), BulkInsertOperationsClient); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified Instance resource. For more information, see Deleting an instance. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteInstanceRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -5293,22 +6731,31 @@ public override Operation Delete(DeleteInstanceRequest request, gaxgrpc::CallSet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteInstanceRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } + /// The long-running operations client for DeleteAccessConfig. + public override lro::OperationsClient DeleteAccessConfigOperationsClient { get; } + /// /// Deletes an access config from an instance's network interface. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation DeleteAccessConfig(DeleteAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation DeleteAccessConfig(DeleteAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteAccessConfigInstanceRequest(ref request, ref callSettings); - return _callDeleteAccessConfig.Sync(request, callSettings); + Operation response = _callDeleteAccessConfig.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteAccessConfigOperationsClient); } /// @@ -5317,22 +6764,31 @@ public override Operation DeleteAccessConfig(DeleteAccessConfigInstanceRequest r /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAccessConfigAsync(DeleteAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAccessConfigAsync(DeleteAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteAccessConfigInstanceRequest(ref request, ref callSettings); - return _callDeleteAccessConfig.Async(request, callSettings); + Operation response = await _callDeleteAccessConfig.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteAccessConfigOperationsClient); } + /// The long-running operations client for DetachDisk. + public override lro::OperationsClient DetachDiskOperationsClient { get; } + /// /// Detaches a disk from an instance. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation DetachDisk(DetachDiskInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation DetachDisk(DetachDiskInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DetachDiskInstanceRequest(ref request, ref callSettings); - return _callDetachDisk.Sync(request, callSettings); + Operation response = _callDetachDisk.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DetachDiskOperationsClient); } /// @@ -5341,10 +6797,13 @@ public override Operation DetachDisk(DetachDiskInstanceRequest request, gaxgrpc: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DetachDiskAsync(DetachDiskInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DetachDiskAsync(DetachDiskInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DetachDiskInstanceRequest(ref request, ref callSettings); - return _callDetachDisk.Async(request, callSettings); + Operation response = await _callDetachDisk.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DetachDiskOperationsClient); } /// @@ -5515,16 +6974,22 @@ public override ShieldedInstanceIdentity GetShieldedInstanceIdentity(GetShielded return _callGetShieldedInstanceIdentity.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates an instance resource in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertInstanceRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -5533,10 +6998,13 @@ public override Operation Insert(InsertInstanceRequest request, gaxgrpc::CallSet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertInstanceRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -5587,16 +7055,22 @@ public override Operation Insert(InsertInstanceRequest request, gaxgrpc::CallSet return new gaxgrpc::GrpcPagedAsyncEnumerable(_callListReferrers, request, callSettings); } + /// The long-running operations client for RemoveResourcePolicies. + public override lro::OperationsClient RemoveResourcePoliciesOperationsClient { get; } + /// /// Removes resource policies from an instance. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation RemoveResourcePolicies(RemoveResourcePoliciesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation RemoveResourcePolicies(RemoveResourcePoliciesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RemoveResourcePoliciesInstanceRequest(ref request, ref callSettings); - return _callRemoveResourcePolicies.Sync(request, callSettings); + Operation response = _callRemoveResourcePolicies.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RemoveResourcePoliciesOperationsClient); } /// @@ -5605,22 +7079,31 @@ public override Operation RemoveResourcePolicies(RemoveResourcePoliciesInstanceR /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task RemoveResourcePoliciesAsync(RemoveResourcePoliciesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> RemoveResourcePoliciesAsync(RemoveResourcePoliciesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RemoveResourcePoliciesInstanceRequest(ref request, ref callSettings); - return _callRemoveResourcePolicies.Async(request, callSettings); + Operation response = await _callRemoveResourcePolicies.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RemoveResourcePoliciesOperationsClient); } + /// The long-running operations client for Reset. + public override lro::OperationsClient ResetOperationsClient { get; } + /// /// Performs a reset on the instance. This is a hard reset the VM does not do a graceful shutdown. For more information, see Resetting an instance. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Reset(ResetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Reset(ResetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ResetInstanceRequest(ref request, ref callSettings); - return _callReset.Sync(request, callSettings); + Operation response = _callReset.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), ResetOperationsClient); } /// @@ -5629,22 +7112,31 @@ public override Operation Reset(ResetInstanceRequest request, gaxgrpc::CallSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task ResetAsync(ResetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> ResetAsync(ResetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ResetInstanceRequest(ref request, ref callSettings); - return _callReset.Async(request, callSettings); + Operation response = await _callReset.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), ResetOperationsClient); } + /// The long-running operations client for SetDeletionProtection. + public override lro::OperationsClient SetDeletionProtectionOperationsClient { get; } + /// /// Sets deletion protection on the instance. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetDeletionProtection(SetDeletionProtectionInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetDeletionProtection(SetDeletionProtectionInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetDeletionProtectionInstanceRequest(ref request, ref callSettings); - return _callSetDeletionProtection.Sync(request, callSettings); + Operation response = _callSetDeletionProtection.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetDeletionProtectionOperationsClient); } /// @@ -5653,22 +7145,31 @@ public override Operation SetDeletionProtection(SetDeletionProtectionInstanceReq /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetDeletionProtectionAsync(SetDeletionProtectionInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetDeletionProtectionAsync(SetDeletionProtectionInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetDeletionProtectionInstanceRequest(ref request, ref callSettings); - return _callSetDeletionProtection.Async(request, callSettings); + Operation response = await _callSetDeletionProtection.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetDeletionProtectionOperationsClient); } + /// The long-running operations client for SetDiskAutoDelete. + public override lro::OperationsClient SetDiskAutoDeleteOperationsClient { get; } + /// /// Sets the auto-delete flag for a disk attached to an instance. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetDiskAutoDelete(SetDiskAutoDeleteInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetDiskAutoDelete(SetDiskAutoDeleteInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetDiskAutoDeleteInstanceRequest(ref request, ref callSettings); - return _callSetDiskAutoDelete.Sync(request, callSettings); + Operation response = _callSetDiskAutoDelete.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetDiskAutoDeleteOperationsClient); } /// @@ -5677,10 +7178,13 @@ public override Operation SetDiskAutoDelete(SetDiskAutoDeleteInstanceRequest req /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetDiskAutoDeleteAsync(SetDiskAutoDeleteInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetDiskAutoDeleteAsync(SetDiskAutoDeleteInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetDiskAutoDeleteInstanceRequest(ref request, ref callSettings); - return _callSetDiskAutoDelete.Async(request, callSettings); + Operation response = await _callSetDiskAutoDelete.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetDiskAutoDeleteOperationsClient); } /// @@ -5707,16 +7211,22 @@ public override Policy SetIamPolicy(SetIamPolicyInstanceRequest request, gaxgrpc return _callSetIamPolicy.Async(request, callSettings); } + /// The long-running operations client for SetLabels. + public override lro::OperationsClient SetLabelsOperationsClient { get; } + /// /// Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetLabels(SetLabelsInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetLabels(SetLabelsInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetLabelsInstanceRequest(ref request, ref callSettings); - return _callSetLabels.Sync(request, callSettings); + Operation response = _callSetLabels.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetLabelsOperationsClient); } /// @@ -5725,22 +7235,31 @@ public override Operation SetLabels(SetLabelsInstanceRequest request, gaxgrpc::C /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetLabelsAsync(SetLabelsInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetLabelsAsync(SetLabelsInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetLabelsInstanceRequest(ref request, ref callSettings); - return _callSetLabels.Async(request, callSettings); + Operation response = await _callSetLabels.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetLabelsOperationsClient); } + /// The long-running operations client for SetMachineResources. + public override lro::OperationsClient SetMachineResourcesOperationsClient { get; } + /// /// Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetMachineResources(SetMachineResourcesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetMachineResources(SetMachineResourcesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetMachineResourcesInstanceRequest(ref request, ref callSettings); - return _callSetMachineResources.Sync(request, callSettings); + Operation response = _callSetMachineResources.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetMachineResourcesOperationsClient); } /// @@ -5749,22 +7268,31 @@ public override Operation SetMachineResources(SetMachineResourcesInstanceRequest /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetMachineResourcesAsync(SetMachineResourcesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetMachineResourcesAsync(SetMachineResourcesInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetMachineResourcesInstanceRequest(ref request, ref callSettings); - return _callSetMachineResources.Async(request, callSettings); + Operation response = await _callSetMachineResources.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetMachineResourcesOperationsClient); } + /// The long-running operations client for SetMachineType. + public override lro::OperationsClient SetMachineTypeOperationsClient { get; } + /// /// Changes the machine type for a stopped instance to the machine type specified in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetMachineType(SetMachineTypeInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetMachineType(SetMachineTypeInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetMachineTypeInstanceRequest(ref request, ref callSettings); - return _callSetMachineType.Sync(request, callSettings); + Operation response = _callSetMachineType.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetMachineTypeOperationsClient); } /// @@ -5773,22 +7301,31 @@ public override Operation SetMachineType(SetMachineTypeInstanceRequest request, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetMachineTypeAsync(SetMachineTypeInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetMachineTypeAsync(SetMachineTypeInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetMachineTypeInstanceRequest(ref request, ref callSettings); - return _callSetMachineType.Async(request, callSettings); + Operation response = await _callSetMachineType.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetMachineTypeOperationsClient); } + /// The long-running operations client for SetMetadata. + public override lro::OperationsClient SetMetadataOperationsClient { get; } + /// /// Sets metadata for the specified instance to the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetMetadata(SetMetadataInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetMetadata(SetMetadataInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetMetadataInstanceRequest(ref request, ref callSettings); - return _callSetMetadata.Sync(request, callSettings); + Operation response = _callSetMetadata.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetMetadataOperationsClient); } /// @@ -5797,22 +7334,31 @@ public override Operation SetMetadata(SetMetadataInstanceRequest request, gaxgrp /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetMetadataAsync(SetMetadataInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetMetadataAsync(SetMetadataInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetMetadataInstanceRequest(ref request, ref callSettings); - return _callSetMetadata.Async(request, callSettings); + Operation response = await _callSetMetadata.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetMetadataOperationsClient); } + /// The long-running operations client for SetMinCpuPlatform. + public override lro::OperationsClient SetMinCpuPlatformOperationsClient { get; } + /// /// Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetMinCpuPlatform(SetMinCpuPlatformInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetMinCpuPlatform(SetMinCpuPlatformInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetMinCpuPlatformInstanceRequest(ref request, ref callSettings); - return _callSetMinCpuPlatform.Sync(request, callSettings); + Operation response = _callSetMinCpuPlatform.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetMinCpuPlatformOperationsClient); } /// @@ -5821,22 +7367,31 @@ public override Operation SetMinCpuPlatform(SetMinCpuPlatformInstanceRequest req /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetMinCpuPlatformAsync(SetMinCpuPlatformInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetMinCpuPlatformAsync(SetMinCpuPlatformInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetMinCpuPlatformInstanceRequest(ref request, ref callSettings); - return _callSetMinCpuPlatform.Async(request, callSettings); + Operation response = await _callSetMinCpuPlatform.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetMinCpuPlatformOperationsClient); } + /// The long-running operations client for SetScheduling. + public override lro::OperationsClient SetSchedulingOperationsClient { get; } + /// /// Sets an instance's scheduling options. You can only call this method on a stopped instance, that is, a VM instance that is in a `TERMINATED` state. See Instance Life Cycle for more information on the possible instance states. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetScheduling(SetSchedulingInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetScheduling(SetSchedulingInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetSchedulingInstanceRequest(ref request, ref callSettings); - return _callSetScheduling.Sync(request, callSettings); + Operation response = _callSetScheduling.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetSchedulingOperationsClient); } /// @@ -5845,22 +7400,31 @@ public override Operation SetScheduling(SetSchedulingInstanceRequest request, ga /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetSchedulingAsync(SetSchedulingInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetSchedulingAsync(SetSchedulingInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetSchedulingInstanceRequest(ref request, ref callSettings); - return _callSetScheduling.Async(request, callSettings); + Operation response = await _callSetScheduling.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetSchedulingOperationsClient); } + /// The long-running operations client for SetServiceAccount. + public override lro::OperationsClient SetServiceAccountOperationsClient { get; } + /// /// Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetServiceAccount(SetServiceAccountInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetServiceAccount(SetServiceAccountInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetServiceAccountInstanceRequest(ref request, ref callSettings); - return _callSetServiceAccount.Sync(request, callSettings); + Operation response = _callSetServiceAccount.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetServiceAccountOperationsClient); } /// @@ -5869,22 +7433,31 @@ public override Operation SetServiceAccount(SetServiceAccountInstanceRequest req /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetServiceAccountAsync(SetServiceAccountInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetServiceAccountAsync(SetServiceAccountInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetServiceAccountInstanceRequest(ref request, ref callSettings); - return _callSetServiceAccount.Async(request, callSettings); + Operation response = await _callSetServiceAccount.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetServiceAccountOperationsClient); } + /// The long-running operations client for SetShieldedInstanceIntegrityPolicy. + public override lro::OperationsClient SetShieldedInstanceIntegrityPolicyOperationsClient { get; } + /// /// Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetShieldedInstanceIntegrityPolicy(SetShieldedInstanceIntegrityPolicyInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetShieldedInstanceIntegrityPolicy(SetShieldedInstanceIntegrityPolicyInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetShieldedInstanceIntegrityPolicyInstanceRequest(ref request, ref callSettings); - return _callSetShieldedInstanceIntegrityPolicy.Sync(request, callSettings); + Operation response = _callSetShieldedInstanceIntegrityPolicy.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetShieldedInstanceIntegrityPolicyOperationsClient); } /// @@ -5893,22 +7466,31 @@ public override Operation SetShieldedInstanceIntegrityPolicy(SetShieldedInstance /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetShieldedInstanceIntegrityPolicyAsync(SetShieldedInstanceIntegrityPolicyInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetShieldedInstanceIntegrityPolicyAsync(SetShieldedInstanceIntegrityPolicyInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetShieldedInstanceIntegrityPolicyInstanceRequest(ref request, ref callSettings); - return _callSetShieldedInstanceIntegrityPolicy.Async(request, callSettings); + Operation response = await _callSetShieldedInstanceIntegrityPolicy.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetShieldedInstanceIntegrityPolicyOperationsClient); } + /// The long-running operations client for SetTags. + public override lro::OperationsClient SetTagsOperationsClient { get; } + /// /// Sets network tags for the specified instance to the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetTags(SetTagsInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetTags(SetTagsInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetTagsInstanceRequest(ref request, ref callSettings); - return _callSetTags.Sync(request, callSettings); + Operation response = _callSetTags.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetTagsOperationsClient); } /// @@ -5917,22 +7499,31 @@ public override Operation SetTags(SetTagsInstanceRequest request, gaxgrpc::CallS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetTagsAsync(SetTagsInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetTagsAsync(SetTagsInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetTagsInstanceRequest(ref request, ref callSettings); - return _callSetTags.Async(request, callSettings); + Operation response = await _callSetTags.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetTagsOperationsClient); } + /// The long-running operations client for SimulateMaintenanceEvent. + public override lro::OperationsClient SimulateMaintenanceEventOperationsClient { get; } + /// /// Simulates a maintenance event on the instance. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SimulateMaintenanceEvent(SimulateMaintenanceEventInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SimulateMaintenanceEvent(SimulateMaintenanceEventInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SimulateMaintenanceEventInstanceRequest(ref request, ref callSettings); - return _callSimulateMaintenanceEvent.Sync(request, callSettings); + Operation response = _callSimulateMaintenanceEvent.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SimulateMaintenanceEventOperationsClient); } /// @@ -5941,22 +7532,31 @@ public override Operation SimulateMaintenanceEvent(SimulateMaintenanceEventInsta /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SimulateMaintenanceEventAsync(SimulateMaintenanceEventInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SimulateMaintenanceEventAsync(SimulateMaintenanceEventInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SimulateMaintenanceEventInstanceRequest(ref request, ref callSettings); - return _callSimulateMaintenanceEvent.Async(request, callSettings); + Operation response = await _callSimulateMaintenanceEvent.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SimulateMaintenanceEventOperationsClient); } + /// The long-running operations client for Start. + public override lro::OperationsClient StartOperationsClient { get; } + /// /// Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Start(StartInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Start(StartInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_StartInstanceRequest(ref request, ref callSettings); - return _callStart.Sync(request, callSettings); + Operation response = _callStart.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), StartOperationsClient); } /// @@ -5965,22 +7565,31 @@ public override Operation Start(StartInstanceRequest request, gaxgrpc::CallSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task StartAsync(StartInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> StartAsync(StartInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_StartInstanceRequest(ref request, ref callSettings); - return _callStart.Async(request, callSettings); + Operation response = await _callStart.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), StartOperationsClient); } + /// The long-running operations client for StartWithEncryptionKey. + public override lro::OperationsClient StartWithEncryptionKeyOperationsClient { get; } + /// /// Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation StartWithEncryptionKey(StartWithEncryptionKeyInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation StartWithEncryptionKey(StartWithEncryptionKeyInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_StartWithEncryptionKeyInstanceRequest(ref request, ref callSettings); - return _callStartWithEncryptionKey.Sync(request, callSettings); + Operation response = _callStartWithEncryptionKey.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), StartWithEncryptionKeyOperationsClient); } /// @@ -5989,22 +7598,31 @@ public override Operation StartWithEncryptionKey(StartWithEncryptionKeyInstanceR /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task StartWithEncryptionKeyAsync(StartWithEncryptionKeyInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> StartWithEncryptionKeyAsync(StartWithEncryptionKeyInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_StartWithEncryptionKeyInstanceRequest(ref request, ref callSettings); - return _callStartWithEncryptionKey.Async(request, callSettings); + Operation response = await _callStartWithEncryptionKey.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), StartWithEncryptionKeyOperationsClient); } + /// The long-running operations client for Stop. + public override lro::OperationsClient StopOperationsClient { get; } + /// /// Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Stop(StopInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Stop(StopInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_StopInstanceRequest(ref request, ref callSettings); - return _callStop.Sync(request, callSettings); + Operation response = _callStop.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), StopOperationsClient); } /// @@ -6013,10 +7631,13 @@ public override Operation Stop(StopInstanceRequest request, gaxgrpc::CallSetting /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task StopAsync(StopInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> StopAsync(StopInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_StopInstanceRequest(ref request, ref callSettings); - return _callStop.Async(request, callSettings); + Operation response = await _callStop.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), StopOperationsClient); } /// @@ -6043,16 +7664,22 @@ public override TestPermissionsResponse TestIamPermissions(TestIamPermissionsIns return _callTestIamPermissions.Async(request, callSettings); } + /// The long-running operations client for Update. + public override lro::OperationsClient UpdateOperationsClient { get; } + /// /// Updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Update(UpdateInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Update(UpdateInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateInstanceRequest(ref request, ref callSettings); - return _callUpdate.Sync(request, callSettings); + Operation response = _callUpdate.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } /// @@ -6061,22 +7688,31 @@ public override Operation Update(UpdateInstanceRequest request, gaxgrpc::CallSet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task UpdateAsync(UpdateInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> UpdateAsync(UpdateInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateInstanceRequest(ref request, ref callSettings); - return _callUpdate.Async(request, callSettings); + Operation response = await _callUpdate.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } + /// The long-running operations client for UpdateAccessConfig. + public override lro::OperationsClient UpdateAccessConfigOperationsClient { get; } + /// /// Updates the specified access config from an instance's network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation UpdateAccessConfig(UpdateAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation UpdateAccessConfig(UpdateAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateAccessConfigInstanceRequest(ref request, ref callSettings); - return _callUpdateAccessConfig.Sync(request, callSettings); + Operation response = _callUpdateAccessConfig.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateAccessConfigOperationsClient); } /// @@ -6085,22 +7721,31 @@ public override Operation UpdateAccessConfig(UpdateAccessConfigInstanceRequest r /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task UpdateAccessConfigAsync(UpdateAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> UpdateAccessConfigAsync(UpdateAccessConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateAccessConfigInstanceRequest(ref request, ref callSettings); - return _callUpdateAccessConfig.Async(request, callSettings); + Operation response = await _callUpdateAccessConfig.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateAccessConfigOperationsClient); } + /// The long-running operations client for UpdateDisplayDevice. + public override lro::OperationsClient UpdateDisplayDeviceOperationsClient { get; } + /// /// Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation UpdateDisplayDevice(UpdateDisplayDeviceInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation UpdateDisplayDevice(UpdateDisplayDeviceInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateDisplayDeviceInstanceRequest(ref request, ref callSettings); - return _callUpdateDisplayDevice.Sync(request, callSettings); + Operation response = _callUpdateDisplayDevice.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateDisplayDeviceOperationsClient); } /// @@ -6109,22 +7754,31 @@ public override Operation UpdateDisplayDevice(UpdateDisplayDeviceInstanceRequest /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task UpdateDisplayDeviceAsync(UpdateDisplayDeviceInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> UpdateDisplayDeviceAsync(UpdateDisplayDeviceInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateDisplayDeviceInstanceRequest(ref request, ref callSettings); - return _callUpdateDisplayDevice.Async(request, callSettings); + Operation response = await _callUpdateDisplayDevice.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateDisplayDeviceOperationsClient); } + /// The long-running operations client for UpdateNetworkInterface. + public override lro::OperationsClient UpdateNetworkInterfaceOperationsClient { get; } + /// /// Updates an instance's network interface. This method can only update an interface's alias IP range and attached network. See Modifying alias IP ranges for an existing instance for instructions on changing alias IP ranges. See Migrating a VM between networks for instructions on migrating an interface. This method follows PATCH semantics. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation UpdateNetworkInterface(UpdateNetworkInterfaceInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation UpdateNetworkInterface(UpdateNetworkInterfaceInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateNetworkInterfaceInstanceRequest(ref request, ref callSettings); - return _callUpdateNetworkInterface.Sync(request, callSettings); + Operation response = _callUpdateNetworkInterface.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateNetworkInterfaceOperationsClient); } /// @@ -6133,22 +7787,31 @@ public override Operation UpdateNetworkInterface(UpdateNetworkInterfaceInstanceR /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task UpdateNetworkInterfaceAsync(UpdateNetworkInterfaceInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> UpdateNetworkInterfaceAsync(UpdateNetworkInterfaceInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateNetworkInterfaceInstanceRequest(ref request, ref callSettings); - return _callUpdateNetworkInterface.Async(request, callSettings); + Operation response = await _callUpdateNetworkInterface.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateNetworkInterfaceOperationsClient); } + /// The long-running operations client for UpdateShieldedInstanceConfig. + public override lro::OperationsClient UpdateShieldedInstanceConfigOperationsClient { get; } + /// /// Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation UpdateShieldedInstanceConfig(UpdateShieldedInstanceConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation UpdateShieldedInstanceConfig(UpdateShieldedInstanceConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateShieldedInstanceConfigInstanceRequest(ref request, ref callSettings); - return _callUpdateShieldedInstanceConfig.Sync(request, callSettings); + Operation response = _callUpdateShieldedInstanceConfig.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateShieldedInstanceConfigOperationsClient); } /// @@ -6157,10 +7820,13 @@ public override Operation UpdateShieldedInstanceConfig(UpdateShieldedInstanceCon /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task UpdateShieldedInstanceConfigAsync(UpdateShieldedInstanceConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> UpdateShieldedInstanceConfigAsync(UpdateShieldedInstanceConfigInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateShieldedInstanceConfigInstanceRequest(ref request, ref callSettings); - return _callUpdateShieldedInstanceConfig.Async(request, callSettings); + Operation response = await _callUpdateShieldedInstanceConfig.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateShieldedInstanceConfigOperationsClient); } } @@ -6217,4 +7883,18 @@ public partial class InstanceListReferrers : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class Instances + { + public partial class InstancesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to ZoneOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForZoneOperations() => + ZoneOperations.ZoneOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InterconnectAttachmentsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InterconnectAttachmentsClient.g.cs index b8db0601babe..0245324f4482 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InterconnectAttachmentsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InterconnectAttachmentsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -48,10 +49,13 @@ private InterconnectAttachmentsSettings(InterconnectAttachmentsSettings existing gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); OnCopy(existing); } @@ -82,6 +86,24 @@ private InterconnectAttachmentsSettings(InterconnectAttachmentsSettings existing /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InterconnectAttachmentsClient.Delete and + /// InterconnectAttachmentsClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InterconnectAttachmentsClient.Get and InterconnectAttachmentsClient.GetAsync. @@ -106,6 +128,24 @@ private InterconnectAttachmentsSettings(InterconnectAttachmentsSettings existing /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InterconnectAttachmentsClient.Insert and + /// InterconnectAttachmentsClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// InterconnectAttachmentsClient.List and InterconnectAttachmentsClient.ListAsync. @@ -130,6 +170,24 @@ private InterconnectAttachmentsSettings(InterconnectAttachmentsSettings existing /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InterconnectAttachmentsClient.Patch and + /// InterconnectAttachmentsClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public InterconnectAttachmentsSettings Clone() => new InterconnectAttachmentsSettings(this); @@ -372,7 +430,7 @@ internal static InterconnectAttachmentsClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -381,7 +439,7 @@ internal static InterconnectAttachmentsClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -390,9 +448,35 @@ internal static InterconnectAttachmentsClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteInterconnectAttachmentRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteInterconnectAttachmentRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified interconnect attachment. /// @@ -407,7 +491,7 @@ internal static InterconnectAttachmentsClient Create(grpccore::CallInvoker callI /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string interconnectAttachment, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string interconnectAttachment, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteInterconnectAttachmentRequest { InterconnectAttachment = gax::GaxPreconditions.CheckNotNullOrEmpty(interconnectAttachment, nameof(interconnectAttachment)), @@ -429,7 +513,7 @@ internal static InterconnectAttachmentsClient Create(grpccore::CallInvoker callI /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string interconnectAttachment, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string interconnectAttachment, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteInterconnectAttachmentRequest { InterconnectAttachment = gax::GaxPreconditions.CheckNotNullOrEmpty(interconnectAttachment, nameof(interconnectAttachment)), @@ -451,7 +535,7 @@ internal static InterconnectAttachmentsClient Create(grpccore::CallInvoker callI /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string interconnectAttachment, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string interconnectAttachment, st::CancellationToken cancellationToken) => DeleteAsync(project, region, interconnectAttachment, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -548,7 +632,7 @@ internal static InterconnectAttachmentsClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -557,7 +641,7 @@ internal static InterconnectAttachmentsClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -566,9 +650,35 @@ internal static InterconnectAttachmentsClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertInterconnectAttachmentRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertInterconnectAttachmentRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates an InterconnectAttachment in the specified project using the data included in the request. /// @@ -583,7 +693,7 @@ internal static InterconnectAttachmentsClient Create(grpccore::CallInvoker callI /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, InterconnectAttachment interconnectAttachmentResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, InterconnectAttachment interconnectAttachmentResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertInterconnectAttachmentRequest { InterconnectAttachmentResource = gax::GaxPreconditions.CheckNotNull(interconnectAttachmentResource, nameof(interconnectAttachmentResource)), @@ -605,7 +715,7 @@ internal static InterconnectAttachmentsClient Create(grpccore::CallInvoker callI /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, InterconnectAttachment interconnectAttachmentResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, InterconnectAttachment interconnectAttachmentResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertInterconnectAttachmentRequest { InterconnectAttachmentResource = gax::GaxPreconditions.CheckNotNull(interconnectAttachmentResource, nameof(interconnectAttachmentResource)), @@ -627,7 +737,7 @@ internal static InterconnectAttachmentsClient Create(grpccore::CallInvoker callI /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, InterconnectAttachment interconnectAttachmentResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, InterconnectAttachment interconnectAttachmentResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, interconnectAttachmentResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -710,7 +820,7 @@ internal static InterconnectAttachmentsClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -719,7 +829,7 @@ internal static InterconnectAttachmentsClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -728,9 +838,35 @@ internal static InterconnectAttachmentsClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchInterconnectAttachmentRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchInterconnectAttachmentRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Updates the specified interconnect attachment with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// @@ -748,7 +884,7 @@ internal static InterconnectAttachmentsClient Create(grpccore::CallInvoker callI /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string region, string interconnectAttachment, InterconnectAttachment interconnectAttachmentResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string region, string interconnectAttachment, InterconnectAttachment interconnectAttachmentResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchInterconnectAttachmentRequest { InterconnectAttachment = gax::GaxPreconditions.CheckNotNullOrEmpty(interconnectAttachment, nameof(interconnectAttachment)), @@ -774,7 +910,7 @@ internal static InterconnectAttachmentsClient Create(grpccore::CallInvoker callI /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, string interconnectAttachment, InterconnectAttachment interconnectAttachmentResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string region, string interconnectAttachment, InterconnectAttachment interconnectAttachmentResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchInterconnectAttachmentRequest { InterconnectAttachment = gax::GaxPreconditions.CheckNotNullOrEmpty(interconnectAttachment, nameof(interconnectAttachment)), @@ -800,7 +936,7 @@ internal static InterconnectAttachmentsClient Create(grpccore::CallInvoker callI /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, string interconnectAttachment, InterconnectAttachment interconnectAttachmentResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string region, string interconnectAttachment, InterconnectAttachment interconnectAttachmentResource, st::CancellationToken cancellationToken) => PatchAsync(project, region, interconnectAttachment, interconnectAttachmentResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -835,6 +971,9 @@ public InterconnectAttachmentsClientImpl(InterconnectAttachments.InterconnectAtt GrpcClient = grpcClient; InterconnectAttachmentsSettings effectiveSettings = settings ?? InterconnectAttachmentsSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.PatchOperationsSettings); _callAggregatedList = clientHelper.BuildApiCall(grpcClient.AggregatedListAsync, grpcClient.AggregatedList, effectiveSettings.AggregatedListSettings).WithGoogleRequestParam("project", request => request.Project); Modify_ApiCall(ref _callAggregatedList); Modify_AggregatedListApiCall(ref _callAggregatedList); @@ -913,16 +1052,22 @@ public InterconnectAttachmentsClientImpl(InterconnectAttachments.InterconnectAtt return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified interconnect attachment. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteInterconnectAttachmentRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -931,10 +1076,13 @@ public override Operation Delete(DeleteInterconnectAttachmentRequest request, ga /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteInterconnectAttachmentRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -961,16 +1109,22 @@ public override InterconnectAttachment Get(GetInterconnectAttachmentRequest requ return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates an InterconnectAttachment in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertInterconnectAttachmentRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -979,10 +1133,13 @@ public override Operation Insert(InsertInterconnectAttachmentRequest request, ga /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertInterconnectAttachmentRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1009,16 +1166,22 @@ public override Operation Insert(InsertInterconnectAttachmentRequest request, ga return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Updates the specified interconnect attachment with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchInterconnectAttachmentRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1027,10 +1190,13 @@ public override Operation Patch(PatchInterconnectAttachmentRequest request, gaxg /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchInterconnectAttachmentRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchInterconnectAttachmentRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } } @@ -1070,4 +1236,18 @@ public partial class InterconnectAttachmentList : gaxgrpc::IPageResponse GetEnumerator(); } + + public static partial class InterconnectAttachments + { + public partial class InterconnectAttachmentsClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InterconnectsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InterconnectsClient.g.cs index 22b0231fdcd4..5cec9668c7c6 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InterconnectsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/InterconnectsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,11 +46,14 @@ private InterconnectsSettings(InterconnectsSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; GetDiagnosticsSettings = existing.GetDiagnosticsSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); OnCopy(existing); } @@ -67,6 +71,24 @@ private InterconnectsSettings(InterconnectsSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InterconnectsClient.Delete and + /// InterconnectsClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to InterconnectsClient.Get /// and InterconnectsClient.GetAsync. @@ -103,6 +125,24 @@ private InterconnectsSettings(InterconnectsSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InterconnectsClient.Insert and + /// InterconnectsClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to InterconnectsClient.List /// and InterconnectsClient.ListAsync. @@ -127,6 +167,24 @@ private InterconnectsSettings(InterconnectsSettings existing) : base(existing) /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to InterconnectsClient.Patch and + /// InterconnectsClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public InterconnectsSettings Clone() => new InterconnectsSettings(this); @@ -296,7 +354,7 @@ internal static InterconnectsClient Create(grpccore::CallInvoker callInvoker, In /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -305,7 +363,7 @@ internal static InterconnectsClient Create(grpccore::CallInvoker callInvoker, In /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -314,9 +372,35 @@ internal static InterconnectsClient Create(grpccore::CallInvoker callInvoker, In /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteInterconnectRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteInterconnectRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified interconnect. /// @@ -328,7 +412,7 @@ internal static InterconnectsClient Create(grpccore::CallInvoker callInvoker, In /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string interconnect, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string interconnect, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteInterconnectRequest { Interconnect = gax::GaxPreconditions.CheckNotNullOrEmpty(interconnect, nameof(interconnect)), @@ -346,7 +430,7 @@ internal static InterconnectsClient Create(grpccore::CallInvoker callInvoker, In /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string interconnect, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string interconnect, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteInterconnectRequest { Interconnect = gax::GaxPreconditions.CheckNotNullOrEmpty(interconnect, nameof(interconnect)), @@ -364,7 +448,7 @@ internal static InterconnectsClient Create(grpccore::CallInvoker callInvoker, In /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string interconnect, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string interconnect, st::CancellationToken cancellationToken) => DeleteAsync(project, interconnect, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -527,7 +611,7 @@ internal static InterconnectsClient Create(grpccore::CallInvoker callInvoker, In /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -536,7 +620,7 @@ internal static InterconnectsClient Create(grpccore::CallInvoker callInvoker, In /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -545,9 +629,35 @@ internal static InterconnectsClient Create(grpccore::CallInvoker callInvoker, In /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertInterconnectRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertInterconnectRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a Interconnect in the specified project using the data included in the request. /// @@ -559,7 +669,7 @@ internal static InterconnectsClient Create(grpccore::CallInvoker callInvoker, In /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, Interconnect interconnectResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, Interconnect interconnectResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertInterconnectRequest { InterconnectResource = gax::GaxPreconditions.CheckNotNull(interconnectResource, nameof(interconnectResource)), @@ -577,7 +687,7 @@ internal static InterconnectsClient Create(grpccore::CallInvoker callInvoker, In /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, Interconnect interconnectResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, Interconnect interconnectResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertInterconnectRequest { InterconnectResource = gax::GaxPreconditions.CheckNotNull(interconnectResource, nameof(interconnectResource)), @@ -595,7 +705,7 @@ internal static InterconnectsClient Create(grpccore::CallInvoker callInvoker, In /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, Interconnect interconnectResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, Interconnect interconnectResource, st::CancellationToken cancellationToken) => InsertAsync(project, interconnectResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -670,7 +780,7 @@ internal static InterconnectsClient Create(grpccore::CallInvoker callInvoker, In /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -679,7 +789,7 @@ internal static InterconnectsClient Create(grpccore::CallInvoker callInvoker, In /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -688,9 +798,35 @@ internal static InterconnectsClient Create(grpccore::CallInvoker callInvoker, In /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchInterconnectRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchInterconnectRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Updates the specified interconnect with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// @@ -705,7 +841,7 @@ internal static InterconnectsClient Create(grpccore::CallInvoker callInvoker, In /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string interconnect, Interconnect interconnectResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string interconnect, Interconnect interconnectResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchInterconnectRequest { Interconnect = gax::GaxPreconditions.CheckNotNullOrEmpty(interconnect, nameof(interconnect)), @@ -727,7 +863,7 @@ internal static InterconnectsClient Create(grpccore::CallInvoker callInvoker, In /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string interconnect, Interconnect interconnectResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string interconnect, Interconnect interconnectResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchInterconnectRequest { Interconnect = gax::GaxPreconditions.CheckNotNullOrEmpty(interconnect, nameof(interconnect)), @@ -749,7 +885,7 @@ internal static InterconnectsClient Create(grpccore::CallInvoker callInvoker, In /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string interconnect, Interconnect interconnectResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string interconnect, Interconnect interconnectResource, st::CancellationToken cancellationToken) => PatchAsync(project, interconnect, interconnectResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -781,6 +917,9 @@ public InterconnectsClientImpl(Interconnects.InterconnectsClient grpcClient, Int GrpcClient = grpcClient; InterconnectsSettings effectiveSettings = settings ?? InterconnectsSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.PatchOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("interconnect", request => request.Interconnect); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -833,16 +972,22 @@ public InterconnectsClientImpl(Interconnects.InterconnectsClient grpcClient, Int partial void Modify_PatchInterconnectRequest(ref PatchInterconnectRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified interconnect. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteInterconnectRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -851,10 +996,13 @@ public override Operation Delete(DeleteInterconnectRequest request, gaxgrpc::Cal /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteInterconnectRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -905,16 +1053,22 @@ public override InterconnectsGetDiagnosticsResponse GetDiagnostics(GetDiagnostic return _callGetDiagnostics.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a Interconnect in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertInterconnectRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -923,10 +1077,13 @@ public override Operation Insert(InsertInterconnectRequest request, gaxgrpc::Cal /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertInterconnectRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -953,16 +1110,22 @@ public override Operation Insert(InsertInterconnectRequest request, gaxgrpc::Cal return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Updates the specified interconnect with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchInterconnectRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -971,10 +1134,13 @@ public override Operation Patch(PatchInterconnectRequest request, gaxgrpc::CallS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchInterconnectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchInterconnectRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } } @@ -995,4 +1161,18 @@ public partial class InterconnectList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class Interconnects + { + public partial class InterconnectsClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/LicensesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/LicensesClient.g.cs index a42ecd057466..64c6cf15a34f 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/LicensesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/LicensesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,9 +46,11 @@ private LicensesSettings(LicensesSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; GetIamPolicySettings = existing.GetIamPolicySettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; SetIamPolicySettings = existing.SetIamPolicySettings; TestIamPermissionsSettings = existing.TestIamPermissionsSettings; @@ -68,6 +71,24 @@ private LicensesSettings(LicensesSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to LicensesClient.Delete and LicensesClient.DeleteAsync + /// . + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to LicensesClient.Get and /// LicensesClient.GetAsync. @@ -104,6 +125,24 @@ private LicensesSettings(LicensesSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to LicensesClient.Insert and LicensesClient.InsertAsync + /// . + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to LicensesClient.List and /// LicensesClient.ListAsync. @@ -308,7 +347,7 @@ internal static LicensesClient Create(grpccore::CallInvoker callInvoker, License /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteLicenseRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteLicenseRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -317,7 +356,7 @@ internal static LicensesClient Create(grpccore::CallInvoker callInvoker, License /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteLicenseRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteLicenseRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -326,9 +365,35 @@ internal static LicensesClient Create(grpccore::CallInvoker callInvoker, License /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteLicenseRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteLicenseRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified license. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. /// @@ -340,7 +405,7 @@ internal static LicensesClient Create(grpccore::CallInvoker callInvoker, License /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string license, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string license, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteLicenseRequest { License = gax::GaxPreconditions.CheckNotNullOrEmpty(license, nameof(license)), @@ -358,7 +423,7 @@ internal static LicensesClient Create(grpccore::CallInvoker callInvoker, License /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string license, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string license, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteLicenseRequest { License = gax::GaxPreconditions.CheckNotNullOrEmpty(license, nameof(license)), @@ -376,7 +441,7 @@ internal static LicensesClient Create(grpccore::CallInvoker callInvoker, License /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string license, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string license, st::CancellationToken cancellationToken) => DeleteAsync(project, license, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -539,7 +604,7 @@ internal static LicensesClient Create(grpccore::CallInvoker callInvoker, License /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertLicenseRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertLicenseRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -548,7 +613,7 @@ internal static LicensesClient Create(grpccore::CallInvoker callInvoker, License /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertLicenseRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertLicenseRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -557,9 +622,35 @@ internal static LicensesClient Create(grpccore::CallInvoker callInvoker, License /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertLicenseRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertLicenseRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Create a License resource in the specified project. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. /// @@ -571,7 +662,7 @@ internal static LicensesClient Create(grpccore::CallInvoker callInvoker, License /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, License licenseResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, License licenseResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertLicenseRequest { LicenseResource = gax::GaxPreconditions.CheckNotNull(licenseResource, nameof(licenseResource)), @@ -589,7 +680,7 @@ internal static LicensesClient Create(grpccore::CallInvoker callInvoker, License /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, License licenseResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, License licenseResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertLicenseRequest { LicenseResource = gax::GaxPreconditions.CheckNotNull(licenseResource, nameof(licenseResource)), @@ -607,7 +698,7 @@ internal static LicensesClient Create(grpccore::CallInvoker callInvoker, License /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, License licenseResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, License licenseResource, st::CancellationToken cancellationToken) => InsertAsync(project, licenseResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -883,6 +974,8 @@ public LicensesClientImpl(Licenses.LicensesClient grpcClient, LicensesSettings s GrpcClient = grpcClient; LicensesSettings effectiveSettings = settings ?? LicensesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("license", request => request.License); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -942,16 +1035,22 @@ public LicensesClientImpl(Licenses.LicensesClient grpcClient, LicensesSettings s partial void Modify_TestIamPermissionsLicenseRequest(ref TestIamPermissionsLicenseRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified license. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteLicenseRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteLicenseRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteLicenseRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -960,10 +1059,13 @@ public override Operation Delete(DeleteLicenseRequest request, gaxgrpc::CallSett /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteLicenseRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteLicenseRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteLicenseRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1014,16 +1116,22 @@ public override Policy GetIamPolicy(GetIamPolicyLicenseRequest request, gaxgrpc: return _callGetIamPolicy.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Create a License resource in the specified project. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertLicenseRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertLicenseRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertLicenseRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1032,10 +1140,13 @@ public override Operation Insert(InsertLicenseRequest request, gaxgrpc::CallSett /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertLicenseRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertLicenseRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertLicenseRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1128,4 +1239,18 @@ public partial class LicensesListResponse : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class Licenses + { + public partial class LicensesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/NetworkEndpointGroupsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/NetworkEndpointGroupsClient.g.cs index 5e16873204d5..e4f74887578d 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/NetworkEndpointGroupsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/NetworkEndpointGroupsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -48,10 +49,14 @@ private NetworkEndpointGroupsSettings(NetworkEndpointGroupsSettings existing) : gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AggregatedListSettings = existing.AggregatedListSettings; AttachNetworkEndpointsSettings = existing.AttachNetworkEndpointsSettings; + AttachNetworkEndpointsOperationsSettings = existing.AttachNetworkEndpointsOperationsSettings.Clone(); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); DetachNetworkEndpointsSettings = existing.DetachNetworkEndpointsSettings; + DetachNetworkEndpointsOperationsSettings = existing.DetachNetworkEndpointsOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; ListNetworkEndpointsSettings = existing.ListNetworkEndpointsSettings; TestIamPermissionsSettings = existing.TestIamPermissionsSettings; @@ -86,6 +91,24 @@ private NetworkEndpointGroupsSettings(NetworkEndpointGroupsSettings existing) : /// public gaxgrpc::CallSettings AttachNetworkEndpointsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to NetworkEndpointGroupsClient.AttachNetworkEndpoints and + /// NetworkEndpointGroupsClient.AttachNetworkEndpointsAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings AttachNetworkEndpointsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// NetworkEndpointGroupsClient.Delete and NetworkEndpointGroupsClient.DeleteAsync. @@ -98,6 +121,24 @@ private NetworkEndpointGroupsSettings(NetworkEndpointGroupsSettings existing) : /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to NetworkEndpointGroupsClient.Delete and + /// NetworkEndpointGroupsClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// NetworkEndpointGroupsClient.DetachNetworkEndpoints and @@ -111,6 +152,24 @@ private NetworkEndpointGroupsSettings(NetworkEndpointGroupsSettings existing) : /// public gaxgrpc::CallSettings DetachNetworkEndpointsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to NetworkEndpointGroupsClient.DetachNetworkEndpoints and + /// NetworkEndpointGroupsClient.DetachNetworkEndpointsAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DetachNetworkEndpointsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// NetworkEndpointGroupsClient.Get and NetworkEndpointGroupsClient.GetAsync. @@ -135,6 +194,24 @@ private NetworkEndpointGroupsSettings(NetworkEndpointGroupsSettings existing) : /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to NetworkEndpointGroupsClient.Insert and + /// NetworkEndpointGroupsClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// NetworkEndpointGroupsClient.List and NetworkEndpointGroupsClient.ListAsync. @@ -415,7 +492,7 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AttachNetworkEndpoints(AttachNetworkEndpointsNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AttachNetworkEndpoints(AttachNetworkEndpointsNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -424,7 +501,7 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AttachNetworkEndpointsAsync(AttachNetworkEndpointsNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AttachNetworkEndpointsAsync(AttachNetworkEndpointsNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -433,9 +510,36 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AttachNetworkEndpointsAsync(AttachNetworkEndpointsNetworkEndpointGroupRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> AttachNetworkEndpointsAsync(AttachNetworkEndpointsNetworkEndpointGroupRequest request, st::CancellationToken cancellationToken) => AttachNetworkEndpointsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for AttachNetworkEndpoints. + public virtual lro::OperationsClient AttachNetworkEndpointsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of + /// AttachNetworkEndpoints. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceAttachNetworkEndpoints(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AttachNetworkEndpointsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// AttachNetworkEndpoints. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceAttachNetworkEndpointsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AttachNetworkEndpointsOperationsClient, callSettings); + /// /// Attach a list of network endpoints to the specified network endpoint group. /// @@ -453,7 +557,7 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AttachNetworkEndpoints(string project, string zone, string networkEndpointGroup, NetworkEndpointGroupsAttachEndpointsRequest networkEndpointGroupsAttachEndpointsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AttachNetworkEndpoints(string project, string zone, string networkEndpointGroup, NetworkEndpointGroupsAttachEndpointsRequest networkEndpointGroupsAttachEndpointsRequestResource, gaxgrpc::CallSettings callSettings = null) => AttachNetworkEndpoints(new AttachNetworkEndpointsNetworkEndpointGroupRequest { NetworkEndpointGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(networkEndpointGroup, nameof(networkEndpointGroup)), @@ -479,7 +583,7 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AttachNetworkEndpointsAsync(string project, string zone, string networkEndpointGroup, NetworkEndpointGroupsAttachEndpointsRequest networkEndpointGroupsAttachEndpointsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AttachNetworkEndpointsAsync(string project, string zone, string networkEndpointGroup, NetworkEndpointGroupsAttachEndpointsRequest networkEndpointGroupsAttachEndpointsRequestResource, gaxgrpc::CallSettings callSettings = null) => AttachNetworkEndpointsAsync(new AttachNetworkEndpointsNetworkEndpointGroupRequest { NetworkEndpointGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(networkEndpointGroup, nameof(networkEndpointGroup)), @@ -505,7 +609,7 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AttachNetworkEndpointsAsync(string project, string zone, string networkEndpointGroup, NetworkEndpointGroupsAttachEndpointsRequest networkEndpointGroupsAttachEndpointsRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> AttachNetworkEndpointsAsync(string project, string zone, string networkEndpointGroup, NetworkEndpointGroupsAttachEndpointsRequest networkEndpointGroupsAttachEndpointsRequestResource, st::CancellationToken cancellationToken) => AttachNetworkEndpointsAsync(project, zone, networkEndpointGroup, networkEndpointGroupsAttachEndpointsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -514,7 +618,7 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -523,7 +627,7 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -532,9 +636,35 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteNetworkEndpointGroupRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteNetworkEndpointGroupRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified network endpoint group. The network endpoints in the NEG and the VM instances they belong to are not terminated when the NEG is deleted. Note that the NEG cannot be deleted if there are backend services referencing it. /// @@ -549,7 +679,7 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string zone, string networkEndpointGroup, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string zone, string networkEndpointGroup, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteNetworkEndpointGroupRequest { NetworkEndpointGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(networkEndpointGroup, nameof(networkEndpointGroup)), @@ -571,7 +701,7 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string zone, string networkEndpointGroup, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string zone, string networkEndpointGroup, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteNetworkEndpointGroupRequest { NetworkEndpointGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(networkEndpointGroup, nameof(networkEndpointGroup)), @@ -593,7 +723,7 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string zone, string networkEndpointGroup, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string zone, string networkEndpointGroup, st::CancellationToken cancellationToken) => DeleteAsync(project, zone, networkEndpointGroup, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -602,7 +732,7 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DetachNetworkEndpoints(DetachNetworkEndpointsNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DetachNetworkEndpoints(DetachNetworkEndpointsNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -611,7 +741,7 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DetachNetworkEndpointsAsync(DetachNetworkEndpointsNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DetachNetworkEndpointsAsync(DetachNetworkEndpointsNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -620,9 +750,36 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DetachNetworkEndpointsAsync(DetachNetworkEndpointsNetworkEndpointGroupRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DetachNetworkEndpointsAsync(DetachNetworkEndpointsNetworkEndpointGroupRequest request, st::CancellationToken cancellationToken) => DetachNetworkEndpointsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for DetachNetworkEndpoints. + public virtual lro::OperationsClient DetachNetworkEndpointsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of + /// DetachNetworkEndpoints. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDetachNetworkEndpoints(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DetachNetworkEndpointsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// DetachNetworkEndpoints. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDetachNetworkEndpointsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DetachNetworkEndpointsOperationsClient, callSettings); + /// /// Detach a list of network endpoints from the specified network endpoint group. /// @@ -640,7 +797,7 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DetachNetworkEndpoints(string project, string zone, string networkEndpointGroup, NetworkEndpointGroupsDetachEndpointsRequest networkEndpointGroupsDetachEndpointsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DetachNetworkEndpoints(string project, string zone, string networkEndpointGroup, NetworkEndpointGroupsDetachEndpointsRequest networkEndpointGroupsDetachEndpointsRequestResource, gaxgrpc::CallSettings callSettings = null) => DetachNetworkEndpoints(new DetachNetworkEndpointsNetworkEndpointGroupRequest { NetworkEndpointGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(networkEndpointGroup, nameof(networkEndpointGroup)), @@ -666,7 +823,7 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DetachNetworkEndpointsAsync(string project, string zone, string networkEndpointGroup, NetworkEndpointGroupsDetachEndpointsRequest networkEndpointGroupsDetachEndpointsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DetachNetworkEndpointsAsync(string project, string zone, string networkEndpointGroup, NetworkEndpointGroupsDetachEndpointsRequest networkEndpointGroupsDetachEndpointsRequestResource, gaxgrpc::CallSettings callSettings = null) => DetachNetworkEndpointsAsync(new DetachNetworkEndpointsNetworkEndpointGroupRequest { NetworkEndpointGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(networkEndpointGroup, nameof(networkEndpointGroup)), @@ -692,7 +849,7 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DetachNetworkEndpointsAsync(string project, string zone, string networkEndpointGroup, NetworkEndpointGroupsDetachEndpointsRequest networkEndpointGroupsDetachEndpointsRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> DetachNetworkEndpointsAsync(string project, string zone, string networkEndpointGroup, NetworkEndpointGroupsDetachEndpointsRequest networkEndpointGroupsDetachEndpointsRequestResource, st::CancellationToken cancellationToken) => DetachNetworkEndpointsAsync(project, zone, networkEndpointGroup, networkEndpointGroupsDetachEndpointsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -789,7 +946,7 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -798,7 +955,7 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -807,9 +964,35 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertNetworkEndpointGroupRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertNetworkEndpointGroupRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a network endpoint group in the specified project using the parameters that are included in the request. /// @@ -824,7 +1007,7 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string zone, NetworkEndpointGroup networkEndpointGroupResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string zone, NetworkEndpointGroup networkEndpointGroupResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertNetworkEndpointGroupRequest { NetworkEndpointGroupResource = gax::GaxPreconditions.CheckNotNull(networkEndpointGroupResource, nameof(networkEndpointGroupResource)), @@ -846,7 +1029,7 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string zone, NetworkEndpointGroup networkEndpointGroupResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string zone, NetworkEndpointGroup networkEndpointGroupResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertNetworkEndpointGroupRequest { NetworkEndpointGroupResource = gax::GaxPreconditions.CheckNotNull(networkEndpointGroupResource, nameof(networkEndpointGroupResource)), @@ -868,7 +1051,7 @@ internal static NetworkEndpointGroupsClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string zone, NetworkEndpointGroup networkEndpointGroupResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string zone, NetworkEndpointGroup networkEndpointGroupResource, st::CancellationToken cancellationToken) => InsertAsync(project, zone, networkEndpointGroupResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1174,6 +1357,10 @@ public NetworkEndpointGroupsClientImpl(NetworkEndpointGroups.NetworkEndpointGrou GrpcClient = grpcClient; NetworkEndpointGroupsSettings effectiveSettings = settings ?? NetworkEndpointGroupsSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + AttachNetworkEndpointsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.AttachNetworkEndpointsOperationsSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.DeleteOperationsSettings); + DetachNetworkEndpointsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.DetachNetworkEndpointsOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.InsertOperationsSettings); _callAggregatedList = clientHelper.BuildApiCall(grpcClient.AggregatedListAsync, grpcClient.AggregatedList, effectiveSettings.AggregatedListSettings).WithGoogleRequestParam("project", request => request.Project); Modify_ApiCall(ref _callAggregatedList); Modify_AggregatedListApiCall(ref _callAggregatedList); @@ -1273,16 +1460,22 @@ public NetworkEndpointGroupsClientImpl(NetworkEndpointGroups.NetworkEndpointGrou return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for AttachNetworkEndpoints. + public override lro::OperationsClient AttachNetworkEndpointsOperationsClient { get; } + /// /// Attach a list of network endpoints to the specified network endpoint group. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation AttachNetworkEndpoints(AttachNetworkEndpointsNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation AttachNetworkEndpoints(AttachNetworkEndpointsNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AttachNetworkEndpointsNetworkEndpointGroupRequest(ref request, ref callSettings); - return _callAttachNetworkEndpoints.Sync(request, callSettings); + Operation response = _callAttachNetworkEndpoints.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AttachNetworkEndpointsOperationsClient); } /// @@ -1291,22 +1484,31 @@ public override Operation AttachNetworkEndpoints(AttachNetworkEndpointsNetworkEn /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task AttachNetworkEndpointsAsync(AttachNetworkEndpointsNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> AttachNetworkEndpointsAsync(AttachNetworkEndpointsNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AttachNetworkEndpointsNetworkEndpointGroupRequest(ref request, ref callSettings); - return _callAttachNetworkEndpoints.Async(request, callSettings); + Operation response = await _callAttachNetworkEndpoints.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AttachNetworkEndpointsOperationsClient); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified network endpoint group. The network endpoints in the NEG and the VM instances they belong to are not terminated when the NEG is deleted. Note that the NEG cannot be deleted if there are backend services referencing it. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteNetworkEndpointGroupRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1315,22 +1517,31 @@ public override Operation Delete(DeleteNetworkEndpointGroupRequest request, gaxg /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteNetworkEndpointGroupRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } + /// The long-running operations client for DetachNetworkEndpoints. + public override lro::OperationsClient DetachNetworkEndpointsOperationsClient { get; } + /// /// Detach a list of network endpoints from the specified network endpoint group. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation DetachNetworkEndpoints(DetachNetworkEndpointsNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation DetachNetworkEndpoints(DetachNetworkEndpointsNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DetachNetworkEndpointsNetworkEndpointGroupRequest(ref request, ref callSettings); - return _callDetachNetworkEndpoints.Sync(request, callSettings); + Operation response = _callDetachNetworkEndpoints.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DetachNetworkEndpointsOperationsClient); } /// @@ -1339,10 +1550,13 @@ public override Operation DetachNetworkEndpoints(DetachNetworkEndpointsNetworkEn /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DetachNetworkEndpointsAsync(DetachNetworkEndpointsNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DetachNetworkEndpointsAsync(DetachNetworkEndpointsNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DetachNetworkEndpointsNetworkEndpointGroupRequest(ref request, ref callSettings); - return _callDetachNetworkEndpoints.Async(request, callSettings); + Operation response = await _callDetachNetworkEndpoints.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DetachNetworkEndpointsOperationsClient); } /// @@ -1369,16 +1583,22 @@ public override NetworkEndpointGroup Get(GetNetworkEndpointGroupRequest request, return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a network endpoint group in the specified project using the parameters that are included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertNetworkEndpointGroupRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1387,10 +1607,13 @@ public override Operation Insert(InsertNetworkEndpointGroupRequest request, gaxg /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertNetworkEndpointGroupRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1506,4 +1729,18 @@ public partial class NetworkEndpointGroupAggregatedList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class NetworkEndpointGroups + { + public partial class NetworkEndpointGroupsClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to ZoneOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForZoneOperations() => + ZoneOperations.ZoneOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/NetworksClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/NetworksClient.g.cs index a9a673cf8c80..cc64c6d63606 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/NetworksClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/NetworksClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,16 +46,23 @@ private NetworksSettings(NetworksSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AddPeeringSettings = existing.AddPeeringSettings; + AddPeeringOperationsSettings = existing.AddPeeringOperationsSettings.Clone(); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; GetEffectiveFirewallsSettings = existing.GetEffectiveFirewallsSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; ListPeeringRoutesSettings = existing.ListPeeringRoutesSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); RemovePeeringSettings = existing.RemovePeeringSettings; + RemovePeeringOperationsSettings = existing.RemovePeeringOperationsSettings.Clone(); SwitchToCustomModeSettings = existing.SwitchToCustomModeSettings; + SwitchToCustomModeOperationsSettings = existing.SwitchToCustomModeOperationsSettings.Clone(); UpdatePeeringSettings = existing.UpdatePeeringSettings; + UpdatePeeringOperationsSettings = existing.UpdatePeeringOperationsSettings.Clone(); OnCopy(existing); } @@ -72,6 +80,24 @@ private NetworksSettings(NetworksSettings existing) : base(existing) /// public gaxgrpc::CallSettings AddPeeringSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to NetworksClient.AddPeering and + /// NetworksClient.AddPeeringAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings AddPeeringOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to NetworksClient.Delete /// and NetworksClient.DeleteAsync. @@ -84,6 +110,24 @@ private NetworksSettings(NetworksSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to NetworksClient.Delete and NetworksClient.DeleteAsync + /// . + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to NetworksClient.Get and /// NetworksClient.GetAsync. @@ -120,6 +164,24 @@ private NetworksSettings(NetworksSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to NetworksClient.Insert and NetworksClient.InsertAsync + /// . + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to NetworksClient.List and /// NetworksClient.ListAsync. @@ -156,6 +218,24 @@ private NetworksSettings(NetworksSettings existing) : base(existing) /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to NetworksClient.Patch and NetworksClient.PatchAsync + /// . + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// NetworksClient.RemovePeering and NetworksClient.RemovePeeringAsync. @@ -168,6 +248,24 @@ private NetworksSettings(NetworksSettings existing) : base(existing) /// public gaxgrpc::CallSettings RemovePeeringSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to NetworksClient.RemovePeering and + /// NetworksClient.RemovePeeringAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings RemovePeeringOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// NetworksClient.SwitchToCustomMode and NetworksClient.SwitchToCustomModeAsync. @@ -180,6 +278,24 @@ private NetworksSettings(NetworksSettings existing) : base(existing) /// public gaxgrpc::CallSettings SwitchToCustomModeSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to NetworksClient.SwitchToCustomMode and + /// NetworksClient.SwitchToCustomModeAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SwitchToCustomModeOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// NetworksClient.UpdatePeering and NetworksClient.UpdatePeeringAsync. @@ -192,6 +308,24 @@ private NetworksSettings(NetworksSettings existing) : base(existing) /// public gaxgrpc::CallSettings UpdatePeeringSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to NetworksClient.UpdatePeering and + /// NetworksClient.UpdatePeeringAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings UpdatePeeringOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public NetworksSettings Clone() => new NetworksSettings(this); @@ -360,7 +494,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddPeering(AddPeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddPeering(AddPeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -369,7 +503,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddPeeringAsync(AddPeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddPeeringAsync(AddPeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -378,9 +512,35 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddPeeringAsync(AddPeeringNetworkRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddPeeringAsync(AddPeeringNetworkRequest request, st::CancellationToken cancellationToken) => AddPeeringAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for AddPeering. + public virtual lro::OperationsClient AddPeeringOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of AddPeering. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceAddPeering(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddPeeringOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// AddPeering. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceAddPeeringAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddPeeringOperationsClient, callSettings); + /// /// Adds a peering to the specified network. /// @@ -395,7 +555,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddPeering(string project, string network, NetworksAddPeeringRequest networksAddPeeringRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddPeering(string project, string network, NetworksAddPeeringRequest networksAddPeeringRequestResource, gaxgrpc::CallSettings callSettings = null) => AddPeering(new AddPeeringNetworkRequest { Network = gax::GaxPreconditions.CheckNotNullOrEmpty(network, nameof(network)), @@ -417,7 +577,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddPeeringAsync(string project, string network, NetworksAddPeeringRequest networksAddPeeringRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddPeeringAsync(string project, string network, NetworksAddPeeringRequest networksAddPeeringRequestResource, gaxgrpc::CallSettings callSettings = null) => AddPeeringAsync(new AddPeeringNetworkRequest { Network = gax::GaxPreconditions.CheckNotNullOrEmpty(network, nameof(network)), @@ -439,7 +599,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddPeeringAsync(string project, string network, NetworksAddPeeringRequest networksAddPeeringRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddPeeringAsync(string project, string network, NetworksAddPeeringRequest networksAddPeeringRequestResource, st::CancellationToken cancellationToken) => AddPeeringAsync(project, network, networksAddPeeringRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -448,7 +608,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -457,7 +617,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -466,9 +626,35 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteNetworkRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteNetworkRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified network. /// @@ -480,7 +666,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string network, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string network, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteNetworkRequest { Network = gax::GaxPreconditions.CheckNotNullOrEmpty(network, nameof(network)), @@ -498,7 +684,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string network, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string network, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteNetworkRequest { Network = gax::GaxPreconditions.CheckNotNullOrEmpty(network, nameof(network)), @@ -516,7 +702,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string network, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string network, st::CancellationToken cancellationToken) => DeleteAsync(project, network, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -679,7 +865,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -688,7 +874,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -697,9 +883,35 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertNetworkRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertNetworkRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a network in the specified project using the data included in the request. /// @@ -711,7 +923,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, Network networkResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, Network networkResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertNetworkRequest { NetworkResource = gax::GaxPreconditions.CheckNotNull(networkResource, nameof(networkResource)), @@ -729,7 +941,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, Network networkResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, Network networkResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertNetworkRequest { NetworkResource = gax::GaxPreconditions.CheckNotNull(networkResource, nameof(networkResource)), @@ -747,7 +959,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, Network networkResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, Network networkResource, st::CancellationToken cancellationToken) => InsertAsync(project, networkResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -896,7 +1108,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -905,7 +1117,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -914,9 +1126,35 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchNetworkRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchNetworkRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode. /// @@ -931,7 +1169,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string network, Network networkResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string network, Network networkResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchNetworkRequest { Network = gax::GaxPreconditions.CheckNotNullOrEmpty(network, nameof(network)), @@ -953,7 +1191,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string network, Network networkResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string network, Network networkResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchNetworkRequest { Network = gax::GaxPreconditions.CheckNotNullOrEmpty(network, nameof(network)), @@ -975,7 +1213,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string network, Network networkResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string network, Network networkResource, st::CancellationToken cancellationToken) => PatchAsync(project, network, networkResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -984,7 +1222,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RemovePeering(RemovePeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RemovePeering(RemovePeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -993,7 +1231,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RemovePeeringAsync(RemovePeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RemovePeeringAsync(RemovePeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1002,9 +1240,35 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RemovePeeringAsync(RemovePeeringNetworkRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> RemovePeeringAsync(RemovePeeringNetworkRequest request, st::CancellationToken cancellationToken) => RemovePeeringAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for RemovePeering. + public virtual lro::OperationsClient RemovePeeringOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of RemovePeering. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceRemovePeering(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RemovePeeringOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// RemovePeering. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceRemovePeeringAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RemovePeeringOperationsClient, callSettings); + /// /// Removes a peering from the specified network. /// @@ -1019,7 +1283,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RemovePeering(string project, string network, NetworksRemovePeeringRequest networksRemovePeeringRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RemovePeering(string project, string network, NetworksRemovePeeringRequest networksRemovePeeringRequestResource, gaxgrpc::CallSettings callSettings = null) => RemovePeering(new RemovePeeringNetworkRequest { Network = gax::GaxPreconditions.CheckNotNullOrEmpty(network, nameof(network)), @@ -1041,7 +1305,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RemovePeeringAsync(string project, string network, NetworksRemovePeeringRequest networksRemovePeeringRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RemovePeeringAsync(string project, string network, NetworksRemovePeeringRequest networksRemovePeeringRequestResource, gaxgrpc::CallSettings callSettings = null) => RemovePeeringAsync(new RemovePeeringNetworkRequest { Network = gax::GaxPreconditions.CheckNotNullOrEmpty(network, nameof(network)), @@ -1063,7 +1327,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RemovePeeringAsync(string project, string network, NetworksRemovePeeringRequest networksRemovePeeringRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> RemovePeeringAsync(string project, string network, NetworksRemovePeeringRequest networksRemovePeeringRequestResource, st::CancellationToken cancellationToken) => RemovePeeringAsync(project, network, networksRemovePeeringRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1072,7 +1336,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SwitchToCustomMode(SwitchToCustomModeNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SwitchToCustomMode(SwitchToCustomModeNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1081,7 +1345,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SwitchToCustomModeAsync(SwitchToCustomModeNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SwitchToCustomModeAsync(SwitchToCustomModeNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1090,9 +1354,36 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SwitchToCustomModeAsync(SwitchToCustomModeNetworkRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SwitchToCustomModeAsync(SwitchToCustomModeNetworkRequest request, st::CancellationToken cancellationToken) => SwitchToCustomModeAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SwitchToCustomMode. + public virtual lro::OperationsClient SwitchToCustomModeOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SwitchToCustomMode + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSwitchToCustomMode(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SwitchToCustomModeOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SwitchToCustomMode. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSwitchToCustomModeAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SwitchToCustomModeOperationsClient, callSettings); + /// /// Switches the network mode from auto subnet mode to custom subnet mode. /// @@ -1104,7 +1395,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SwitchToCustomMode(string project, string network, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SwitchToCustomMode(string project, string network, gaxgrpc::CallSettings callSettings = null) => SwitchToCustomMode(new SwitchToCustomModeNetworkRequest { Network = gax::GaxPreconditions.CheckNotNullOrEmpty(network, nameof(network)), @@ -1122,7 +1413,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SwitchToCustomModeAsync(string project, string network, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SwitchToCustomModeAsync(string project, string network, gaxgrpc::CallSettings callSettings = null) => SwitchToCustomModeAsync(new SwitchToCustomModeNetworkRequest { Network = gax::GaxPreconditions.CheckNotNullOrEmpty(network, nameof(network)), @@ -1140,7 +1431,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SwitchToCustomModeAsync(string project, string network, st::CancellationToken cancellationToken) => + public virtual stt::Task> SwitchToCustomModeAsync(string project, string network, st::CancellationToken cancellationToken) => SwitchToCustomModeAsync(project, network, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1149,7 +1440,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation UpdatePeering(UpdatePeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation UpdatePeering(UpdatePeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1158,7 +1449,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdatePeeringAsync(UpdatePeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdatePeeringAsync(UpdatePeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1167,9 +1458,35 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdatePeeringAsync(UpdatePeeringNetworkRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdatePeeringAsync(UpdatePeeringNetworkRequest request, st::CancellationToken cancellationToken) => UpdatePeeringAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for UpdatePeering. + public virtual lro::OperationsClient UpdatePeeringOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of UpdatePeering. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceUpdatePeering(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdatePeeringOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// UpdatePeering. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceUpdatePeeringAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdatePeeringOperationsClient, callSettings); + /// /// Updates the specified network peering with the data included in the request Only the following fields can be modified: NetworkPeering.export_custom_routes, and NetworkPeering.import_custom_routes /// @@ -1184,7 +1501,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation UpdatePeering(string project, string network, NetworksUpdatePeeringRequest networksUpdatePeeringRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation UpdatePeering(string project, string network, NetworksUpdatePeeringRequest networksUpdatePeeringRequestResource, gaxgrpc::CallSettings callSettings = null) => UpdatePeering(new UpdatePeeringNetworkRequest { Network = gax::GaxPreconditions.CheckNotNullOrEmpty(network, nameof(network)), @@ -1206,7 +1523,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdatePeeringAsync(string project, string network, NetworksUpdatePeeringRequest networksUpdatePeeringRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdatePeeringAsync(string project, string network, NetworksUpdatePeeringRequest networksUpdatePeeringRequestResource, gaxgrpc::CallSettings callSettings = null) => UpdatePeeringAsync(new UpdatePeeringNetworkRequest { Network = gax::GaxPreconditions.CheckNotNullOrEmpty(network, nameof(network)), @@ -1228,7 +1545,7 @@ internal static NetworksClient Create(grpccore::CallInvoker callInvoker, Network /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdatePeeringAsync(string project, string network, NetworksUpdatePeeringRequest networksUpdatePeeringRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdatePeeringAsync(string project, string network, NetworksUpdatePeeringRequest networksUpdatePeeringRequestResource, st::CancellationToken cancellationToken) => UpdatePeeringAsync(project, network, networksUpdatePeeringRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -1270,6 +1587,13 @@ public NetworksClientImpl(Networks.NetworksClient grpcClient, NetworksSettings s GrpcClient = grpcClient; NetworksSettings effectiveSettings = settings ?? NetworksSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + AddPeeringOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.AddPeeringOperationsSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.PatchOperationsSettings); + RemovePeeringOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.RemovePeeringOperationsSettings); + SwitchToCustomModeOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.SwitchToCustomModeOperationsSettings); + UpdatePeeringOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.UpdatePeeringOperationsSettings); _callAddPeering = clientHelper.BuildApiCall(grpcClient.AddPeeringAsync, grpcClient.AddPeering, effectiveSettings.AddPeeringSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("network", request => request.Network); Modify_ApiCall(ref _callAddPeering); Modify_AddPeeringApiCall(ref _callAddPeering); @@ -1357,16 +1681,22 @@ public NetworksClientImpl(Networks.NetworksClient grpcClient, NetworksSettings s partial void Modify_UpdatePeeringNetworkRequest(ref UpdatePeeringNetworkRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for AddPeering. + public override lro::OperationsClient AddPeeringOperationsClient { get; } + /// /// Adds a peering to the specified network. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation AddPeering(AddPeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation AddPeering(AddPeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddPeeringNetworkRequest(ref request, ref callSettings); - return _callAddPeering.Sync(request, callSettings); + Operation response = _callAddPeering.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddPeeringOperationsClient); } /// @@ -1375,22 +1705,31 @@ public override Operation AddPeering(AddPeeringNetworkRequest request, gaxgrpc:: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task AddPeeringAsync(AddPeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> AddPeeringAsync(AddPeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddPeeringNetworkRequest(ref request, ref callSettings); - return _callAddPeering.Async(request, callSettings); + Operation response = await _callAddPeering.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddPeeringOperationsClient); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified network. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteNetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteNetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteNetworkRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1399,10 +1738,13 @@ public override Operation Delete(DeleteNetworkRequest request, gaxgrpc::CallSett /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteNetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteNetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteNetworkRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1453,16 +1795,22 @@ public override NetworksGetEffectiveFirewallsResponse GetEffectiveFirewalls(GetE return _callGetEffectiveFirewalls.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a network in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertNetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertNetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertNetworkRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1471,10 +1819,13 @@ public override Operation Insert(InsertNetworkRequest request, gaxgrpc::CallSett /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertNetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertNetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertNetworkRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1525,16 +1876,22 @@ public override Operation Insert(InsertNetworkRequest request, gaxgrpc::CallSett return new gaxgrpc::GrpcPagedAsyncEnumerable(_callListPeeringRoutes, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchNetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchNetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchNetworkRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1543,22 +1900,31 @@ public override Operation Patch(PatchNetworkRequest request, gaxgrpc::CallSettin /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchNetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchNetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchNetworkRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } + /// The long-running operations client for RemovePeering. + public override lro::OperationsClient RemovePeeringOperationsClient { get; } + /// /// Removes a peering from the specified network. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation RemovePeering(RemovePeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation RemovePeering(RemovePeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RemovePeeringNetworkRequest(ref request, ref callSettings); - return _callRemovePeering.Sync(request, callSettings); + Operation response = _callRemovePeering.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RemovePeeringOperationsClient); } /// @@ -1567,22 +1933,31 @@ public override Operation RemovePeering(RemovePeeringNetworkRequest request, gax /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task RemovePeeringAsync(RemovePeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> RemovePeeringAsync(RemovePeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RemovePeeringNetworkRequest(ref request, ref callSettings); - return _callRemovePeering.Async(request, callSettings); + Operation response = await _callRemovePeering.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RemovePeeringOperationsClient); } + /// The long-running operations client for SwitchToCustomMode. + public override lro::OperationsClient SwitchToCustomModeOperationsClient { get; } + /// /// Switches the network mode from auto subnet mode to custom subnet mode. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SwitchToCustomMode(SwitchToCustomModeNetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SwitchToCustomMode(SwitchToCustomModeNetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SwitchToCustomModeNetworkRequest(ref request, ref callSettings); - return _callSwitchToCustomMode.Sync(request, callSettings); + Operation response = _callSwitchToCustomMode.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SwitchToCustomModeOperationsClient); } /// @@ -1591,22 +1966,31 @@ public override Operation SwitchToCustomMode(SwitchToCustomModeNetworkRequest re /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SwitchToCustomModeAsync(SwitchToCustomModeNetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SwitchToCustomModeAsync(SwitchToCustomModeNetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SwitchToCustomModeNetworkRequest(ref request, ref callSettings); - return _callSwitchToCustomMode.Async(request, callSettings); + Operation response = await _callSwitchToCustomMode.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SwitchToCustomModeOperationsClient); } + /// The long-running operations client for UpdatePeering. + public override lro::OperationsClient UpdatePeeringOperationsClient { get; } + /// /// Updates the specified network peering with the data included in the request Only the following fields can be modified: NetworkPeering.export_custom_routes, and NetworkPeering.import_custom_routes /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation UpdatePeering(UpdatePeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation UpdatePeering(UpdatePeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdatePeeringNetworkRequest(ref request, ref callSettings); - return _callUpdatePeering.Sync(request, callSettings); + Operation response = _callUpdatePeering.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdatePeeringOperationsClient); } /// @@ -1615,10 +1999,13 @@ public override Operation UpdatePeering(UpdatePeeringNetworkRequest request, gax /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task UpdatePeeringAsync(UpdatePeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> UpdatePeeringAsync(UpdatePeeringNetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdatePeeringNetworkRequest(ref request, ref callSettings); - return _callUpdatePeering.Async(request, callSettings); + Operation response = await _callUpdatePeering.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdatePeeringOperationsClient); } } @@ -1657,4 +2044,18 @@ public partial class ExchangedPeeringRoutesList : gaxgrpc::IPageResponse GetEnumerator(); } + + public static partial class Networks + { + public partial class NetworksClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/NodeGroupsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/NodeGroupsClient.g.cs index a2352ce82596..975abed800f4 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/NodeGroupsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/NodeGroupsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,17 +46,23 @@ private NodeGroupsSettings(NodeGroupsSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AddNodesSettings = existing.AddNodesSettings; + AddNodesOperationsSettings = existing.AddNodesOperationsSettings.Clone(); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); DeleteNodesSettings = existing.DeleteNodesSettings; + DeleteNodesOperationsSettings = existing.DeleteNodesOperationsSettings.Clone(); GetSettings = existing.GetSettings; GetIamPolicySettings = existing.GetIamPolicySettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; ListNodesSettings = existing.ListNodesSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); SetIamPolicySettings = existing.SetIamPolicySettings; SetNodeTemplateSettings = existing.SetNodeTemplateSettings; + SetNodeTemplateOperationsSettings = existing.SetNodeTemplateOperationsSettings.Clone(); TestIamPermissionsSettings = existing.TestIamPermissionsSettings; OnCopy(existing); } @@ -74,6 +81,24 @@ private NodeGroupsSettings(NodeGroupsSettings existing) : base(existing) /// public gaxgrpc::CallSettings AddNodesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to NodeGroupsClient.AddNodes and + /// NodeGroupsClient.AddNodesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings AddNodesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// NodeGroupsClient.AggregatedList and NodeGroupsClient.AggregatedListAsync. @@ -98,6 +123,24 @@ private NodeGroupsSettings(NodeGroupsSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to NodeGroupsClient.Delete and + /// NodeGroupsClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// NodeGroupsClient.DeleteNodes and NodeGroupsClient.DeleteNodesAsync. @@ -110,6 +153,24 @@ private NodeGroupsSettings(NodeGroupsSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteNodesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to NodeGroupsClient.DeleteNodes and + /// NodeGroupsClient.DeleteNodesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteNodesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to NodeGroupsClient.Get /// and NodeGroupsClient.GetAsync. @@ -146,6 +207,24 @@ private NodeGroupsSettings(NodeGroupsSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to NodeGroupsClient.Insert and + /// NodeGroupsClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to NodeGroupsClient.List /// and NodeGroupsClient.ListAsync. @@ -182,6 +261,24 @@ private NodeGroupsSettings(NodeGroupsSettings existing) : base(existing) /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to NodeGroupsClient.Patch and + /// NodeGroupsClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// NodeGroupsClient.SetIamPolicy and NodeGroupsClient.SetIamPolicyAsync. @@ -206,6 +303,24 @@ private NodeGroupsSettings(NodeGroupsSettings existing) : base(existing) /// public gaxgrpc::CallSettings SetNodeTemplateSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to NodeGroupsClient.SetNodeTemplate and + /// NodeGroupsClient.SetNodeTemplateAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetNodeTemplateOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// NodeGroupsClient.TestIamPermissions and NodeGroupsClient.TestIamPermissionsAsync. @@ -386,7 +501,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddNodes(AddNodesNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddNodes(AddNodesNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -395,7 +510,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddNodesAsync(AddNodesNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddNodesAsync(AddNodesNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -404,9 +519,35 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddNodesAsync(AddNodesNodeGroupRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddNodesAsync(AddNodesNodeGroupRequest request, st::CancellationToken cancellationToken) => AddNodesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for AddNodes. + public virtual lro::OperationsClient AddNodesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of AddNodes. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceAddNodes(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddNodesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// AddNodes. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceAddNodesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddNodesOperationsClient, callSettings); + /// /// Adds specified number of nodes to the node group. /// @@ -424,7 +565,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddNodes(string project, string zone, string nodeGroup, NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddNodes(string project, string zone, string nodeGroup, NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource, gaxgrpc::CallSettings callSettings = null) => AddNodes(new AddNodesNodeGroupRequest { NodeGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(nodeGroup, nameof(nodeGroup)), @@ -450,7 +591,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddNodesAsync(string project, string zone, string nodeGroup, NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddNodesAsync(string project, string zone, string nodeGroup, NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource, gaxgrpc::CallSettings callSettings = null) => AddNodesAsync(new AddNodesNodeGroupRequest { NodeGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(nodeGroup, nameof(nodeGroup)), @@ -476,7 +617,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddNodesAsync(string project, string zone, string nodeGroup, NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddNodesAsync(string project, string zone, string nodeGroup, NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource, st::CancellationToken cancellationToken) => AddNodesAsync(project, zone, nodeGroup, nodeGroupsAddNodesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -555,7 +696,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -564,7 +705,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -573,9 +714,35 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteNodeGroupRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteNodeGroupRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified NodeGroup resource. /// @@ -590,7 +757,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string zone, string nodeGroup, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string zone, string nodeGroup, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteNodeGroupRequest { NodeGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(nodeGroup, nameof(nodeGroup)), @@ -612,7 +779,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string zone, string nodeGroup, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string zone, string nodeGroup, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteNodeGroupRequest { NodeGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(nodeGroup, nameof(nodeGroup)), @@ -634,7 +801,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string zone, string nodeGroup, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string zone, string nodeGroup, st::CancellationToken cancellationToken) => DeleteAsync(project, zone, nodeGroup, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -643,7 +810,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DeleteNodes(DeleteNodesNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DeleteNodes(DeleteNodesNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -652,7 +819,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteNodesAsync(DeleteNodesNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteNodesAsync(DeleteNodesNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -661,9 +828,35 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteNodesAsync(DeleteNodesNodeGroupRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteNodesAsync(DeleteNodesNodeGroupRequest request, st::CancellationToken cancellationToken) => DeleteNodesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for DeleteNodes. + public virtual lro::OperationsClient DeleteNodesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of DeleteNodes. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDeleteNodes(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteNodesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// DeleteNodes. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteNodesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteNodesOperationsClient, callSettings); + /// /// Deletes specified nodes from the node group. /// @@ -681,7 +874,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DeleteNodes(string project, string zone, string nodeGroup, NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DeleteNodes(string project, string zone, string nodeGroup, NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource, gaxgrpc::CallSettings callSettings = null) => DeleteNodes(new DeleteNodesNodeGroupRequest { NodeGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(nodeGroup, nameof(nodeGroup)), @@ -707,7 +900,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteNodesAsync(string project, string zone, string nodeGroup, NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteNodesAsync(string project, string zone, string nodeGroup, NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource, gaxgrpc::CallSettings callSettings = null) => DeleteNodesAsync(new DeleteNodesNodeGroupRequest { NodeGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(nodeGroup, nameof(nodeGroup)), @@ -733,7 +926,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteNodesAsync(string project, string zone, string nodeGroup, NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteNodesAsync(string project, string zone, string nodeGroup, NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource, st::CancellationToken cancellationToken) => DeleteNodesAsync(project, zone, nodeGroup, nodeGroupsDeleteNodesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -918,7 +1111,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -927,7 +1120,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -936,9 +1129,35 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertNodeGroupRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertNodeGroupRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a NodeGroup resource in the specified project using the data included in the request. /// @@ -956,7 +1175,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string zone, int initialNodeCount, NodeGroup nodeGroupResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string zone, int initialNodeCount, NodeGroup nodeGroupResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertNodeGroupRequest { InitialNodeCount = initialNodeCount, @@ -982,7 +1201,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string zone, int initialNodeCount, NodeGroup nodeGroupResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string zone, int initialNodeCount, NodeGroup nodeGroupResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertNodeGroupRequest { InitialNodeCount = initialNodeCount, @@ -1008,7 +1227,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string zone, int initialNodeCount, NodeGroup nodeGroupResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string zone, int initialNodeCount, NodeGroup nodeGroupResource, st::CancellationToken cancellationToken) => InsertAsync(project, zone, initialNodeCount, nodeGroupResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1173,7 +1392,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1182,7 +1401,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1191,9 +1410,35 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchNodeGroupRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchNodeGroupRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Updates the specified node group. /// @@ -1211,7 +1456,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string zone, string nodeGroup, NodeGroup nodeGroupResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string zone, string nodeGroup, NodeGroup nodeGroupResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchNodeGroupRequest { NodeGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(nodeGroup, nameof(nodeGroup)), @@ -1237,7 +1482,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string zone, string nodeGroup, NodeGroup nodeGroupResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string zone, string nodeGroup, NodeGroup nodeGroupResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchNodeGroupRequest { NodeGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(nodeGroup, nameof(nodeGroup)), @@ -1263,7 +1508,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string zone, string nodeGroup, NodeGroup nodeGroupResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string zone, string nodeGroup, NodeGroup nodeGroupResource, st::CancellationToken cancellationToken) => PatchAsync(project, zone, nodeGroup, nodeGroupResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1371,7 +1616,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetNodeTemplate(SetNodeTemplateNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetNodeTemplate(SetNodeTemplateNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1380,7 +1625,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetNodeTemplateAsync(SetNodeTemplateNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetNodeTemplateAsync(SetNodeTemplateNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1389,9 +1634,35 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetNodeTemplateAsync(SetNodeTemplateNodeGroupRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetNodeTemplateAsync(SetNodeTemplateNodeGroupRequest request, st::CancellationToken cancellationToken) => SetNodeTemplateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetNodeTemplate. + public virtual lro::OperationsClient SetNodeTemplateOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetNodeTemplate. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetNodeTemplate(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetNodeTemplateOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetNodeTemplate. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetNodeTemplateAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetNodeTemplateOperationsClient, callSettings); + /// /// Updates the node template of the node group. /// @@ -1409,7 +1680,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetNodeTemplate(string project, string zone, string nodeGroup, NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetNodeTemplate(string project, string zone, string nodeGroup, NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource, gaxgrpc::CallSettings callSettings = null) => SetNodeTemplate(new SetNodeTemplateNodeGroupRequest { NodeGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(nodeGroup, nameof(nodeGroup)), @@ -1435,7 +1706,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetNodeTemplateAsync(string project, string zone, string nodeGroup, NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetNodeTemplateAsync(string project, string zone, string nodeGroup, NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource, gaxgrpc::CallSettings callSettings = null) => SetNodeTemplateAsync(new SetNodeTemplateNodeGroupRequest { NodeGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(nodeGroup, nameof(nodeGroup)), @@ -1461,7 +1732,7 @@ internal static NodeGroupsClient Create(grpccore::CallInvoker callInvoker, NodeG /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetNodeTemplateAsync(string project, string zone, string nodeGroup, NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetNodeTemplateAsync(string project, string zone, string nodeGroup, NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource, st::CancellationToken cancellationToken) => SetNodeTemplateAsync(project, zone, nodeGroup, nodeGroupsSetNodeTemplateRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1606,6 +1877,12 @@ public NodeGroupsClientImpl(NodeGroups.NodeGroupsClient grpcClient, NodeGroupsSe GrpcClient = grpcClient; NodeGroupsSettings effectiveSettings = settings ?? NodeGroupsSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + AddNodesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.AddNodesOperationsSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.DeleteOperationsSettings); + DeleteNodesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.DeleteNodesOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.PatchOperationsSettings); + SetNodeTemplateOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.SetNodeTemplateOperationsSettings); _callAddNodes = clientHelper.BuildApiCall(grpcClient.AddNodesAsync, grpcClient.AddNodes, effectiveSettings.AddNodesSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("zone", request => request.Zone).WithGoogleRequestParam("node_group", request => request.NodeGroup); Modify_ApiCall(ref _callAddNodes); Modify_AddNodesApiCall(ref _callAddNodes); @@ -1707,16 +1984,22 @@ public NodeGroupsClientImpl(NodeGroups.NodeGroupsClient grpcClient, NodeGroupsSe partial void Modify_TestIamPermissionsNodeGroupRequest(ref TestIamPermissionsNodeGroupRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for AddNodes. + public override lro::OperationsClient AddNodesOperationsClient { get; } + /// /// Adds specified number of nodes to the node group. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation AddNodes(AddNodesNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation AddNodes(AddNodesNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddNodesNodeGroupRequest(ref request, ref callSettings); - return _callAddNodes.Sync(request, callSettings); + Operation response = _callAddNodes.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddNodesOperationsClient); } /// @@ -1725,10 +2008,13 @@ public override Operation AddNodes(AddNodesNodeGroupRequest request, gaxgrpc::Ca /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task AddNodesAsync(AddNodesNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> AddNodesAsync(AddNodesNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddNodesNodeGroupRequest(ref request, ref callSettings); - return _callAddNodes.Async(request, callSettings); + Operation response = await _callAddNodes.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddNodesOperationsClient); } /// @@ -1757,16 +2043,22 @@ public override Operation AddNodes(AddNodesNodeGroupRequest request, gaxgrpc::Ca return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified NodeGroup resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteNodeGroupRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1775,22 +2067,31 @@ public override Operation Delete(DeleteNodeGroupRequest request, gaxgrpc::CallSe /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteNodeGroupRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } + /// The long-running operations client for DeleteNodes. + public override lro::OperationsClient DeleteNodesOperationsClient { get; } + /// /// Deletes specified nodes from the node group. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation DeleteNodes(DeleteNodesNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation DeleteNodes(DeleteNodesNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteNodesNodeGroupRequest(ref request, ref callSettings); - return _callDeleteNodes.Sync(request, callSettings); + Operation response = _callDeleteNodes.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteNodesOperationsClient); } /// @@ -1799,10 +2100,13 @@ public override Operation DeleteNodes(DeleteNodesNodeGroupRequest request, gaxgr /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteNodesAsync(DeleteNodesNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteNodesAsync(DeleteNodesNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteNodesNodeGroupRequest(ref request, ref callSettings); - return _callDeleteNodes.Async(request, callSettings); + Operation response = await _callDeleteNodes.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteNodesOperationsClient); } /// @@ -1853,16 +2157,22 @@ public override Policy GetIamPolicy(GetIamPolicyNodeGroupRequest request, gaxgrp return _callGetIamPolicy.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a NodeGroup resource in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertNodeGroupRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1871,10 +2181,13 @@ public override Operation Insert(InsertNodeGroupRequest request, gaxgrpc::CallSe /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertNodeGroupRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1925,16 +2238,22 @@ public override Operation Insert(InsertNodeGroupRequest request, gaxgrpc::CallSe return new gaxgrpc::GrpcPagedAsyncEnumerable(_callListNodes, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Updates the specified node group. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchNodeGroupRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1943,10 +2262,13 @@ public override Operation Patch(PatchNodeGroupRequest request, gaxgrpc::CallSett /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchNodeGroupRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1973,16 +2295,22 @@ public override Policy SetIamPolicy(SetIamPolicyNodeGroupRequest request, gaxgrp return _callSetIamPolicy.Async(request, callSettings); } + /// The long-running operations client for SetNodeTemplate. + public override lro::OperationsClient SetNodeTemplateOperationsClient { get; } + /// /// Updates the node template of the node group. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetNodeTemplate(SetNodeTemplateNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetNodeTemplate(SetNodeTemplateNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetNodeTemplateNodeGroupRequest(ref request, ref callSettings); - return _callSetNodeTemplate.Sync(request, callSettings); + Operation response = _callSetNodeTemplate.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetNodeTemplateOperationsClient); } /// @@ -1991,10 +2319,13 @@ public override Operation SetNodeTemplate(SetNodeTemplateNodeGroupRequest reques /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetNodeTemplateAsync(SetNodeTemplateNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetNodeTemplateAsync(SetNodeTemplateNodeGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetNodeTemplateNodeGroupRequest(ref request, ref callSettings); - return _callSetNodeTemplate.Async(request, callSettings); + Operation response = await _callSetNodeTemplate.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetNodeTemplateOperationsClient); } /// @@ -2075,4 +2406,18 @@ public partial class NodeGroupsListNodes : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class NodeGroups + { + public partial class NodeGroupsClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to ZoneOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForZoneOperations() => + ZoneOperations.ZoneOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/NodeTemplatesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/NodeTemplatesClient.g.cs index 5ec82ab0c6e0..93ba0ab32728 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/NodeTemplatesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/NodeTemplatesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -46,9 +47,11 @@ private NodeTemplatesSettings(NodeTemplatesSettings existing) : base(existing) gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; GetIamPolicySettings = existing.GetIamPolicySettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; SetIamPolicySettings = existing.SetIamPolicySettings; TestIamPermissionsSettings = existing.TestIamPermissionsSettings; @@ -81,6 +84,24 @@ private NodeTemplatesSettings(NodeTemplatesSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to NodeTemplatesClient.Delete and + /// NodeTemplatesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to NodeTemplatesClient.Get /// and NodeTemplatesClient.GetAsync. @@ -117,6 +138,24 @@ private NodeTemplatesSettings(NodeTemplatesSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to NodeTemplatesClient.Insert and + /// NodeTemplatesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to NodeTemplatesClient.List /// and NodeTemplatesClient.ListAsync. @@ -392,7 +431,7 @@ internal static NodeTemplatesClient Create(grpccore::CallInvoker callInvoker, No /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteNodeTemplateRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteNodeTemplateRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -401,7 +440,7 @@ internal static NodeTemplatesClient Create(grpccore::CallInvoker callInvoker, No /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteNodeTemplateRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteNodeTemplateRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -410,9 +449,35 @@ internal static NodeTemplatesClient Create(grpccore::CallInvoker callInvoker, No /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteNodeTemplateRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteNodeTemplateRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified NodeTemplate resource. /// @@ -427,7 +492,7 @@ internal static NodeTemplatesClient Create(grpccore::CallInvoker callInvoker, No /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string nodeTemplate, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string nodeTemplate, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteNodeTemplateRequest { NodeTemplate = gax::GaxPreconditions.CheckNotNullOrEmpty(nodeTemplate, nameof(nodeTemplate)), @@ -449,7 +514,7 @@ internal static NodeTemplatesClient Create(grpccore::CallInvoker callInvoker, No /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string nodeTemplate, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string nodeTemplate, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteNodeTemplateRequest { NodeTemplate = gax::GaxPreconditions.CheckNotNullOrEmpty(nodeTemplate, nameof(nodeTemplate)), @@ -471,7 +536,7 @@ internal static NodeTemplatesClient Create(grpccore::CallInvoker callInvoker, No /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string nodeTemplate, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string nodeTemplate, st::CancellationToken cancellationToken) => DeleteAsync(project, region, nodeTemplate, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -656,7 +721,7 @@ internal static NodeTemplatesClient Create(grpccore::CallInvoker callInvoker, No /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertNodeTemplateRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertNodeTemplateRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -665,7 +730,7 @@ internal static NodeTemplatesClient Create(grpccore::CallInvoker callInvoker, No /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertNodeTemplateRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertNodeTemplateRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -674,9 +739,35 @@ internal static NodeTemplatesClient Create(grpccore::CallInvoker callInvoker, No /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertNodeTemplateRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertNodeTemplateRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a NodeTemplate resource in the specified project using the data included in the request. /// @@ -691,7 +782,7 @@ internal static NodeTemplatesClient Create(grpccore::CallInvoker callInvoker, No /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, NodeTemplate nodeTemplateResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, NodeTemplate nodeTemplateResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertNodeTemplateRequest { NodeTemplateResource = gax::GaxPreconditions.CheckNotNull(nodeTemplateResource, nameof(nodeTemplateResource)), @@ -713,7 +804,7 @@ internal static NodeTemplatesClient Create(grpccore::CallInvoker callInvoker, No /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, NodeTemplate nodeTemplateResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, NodeTemplate nodeTemplateResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertNodeTemplateRequest { NodeTemplateResource = gax::GaxPreconditions.CheckNotNull(nodeTemplateResource, nameof(nodeTemplateResource)), @@ -735,7 +826,7 @@ internal static NodeTemplatesClient Create(grpccore::CallInvoker callInvoker, No /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, NodeTemplate nodeTemplateResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, NodeTemplate nodeTemplateResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, nodeTemplateResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1043,6 +1134,8 @@ public NodeTemplatesClientImpl(NodeTemplates.NodeTemplatesClient grpcClient, Nod GrpcClient = grpcClient; NodeTemplatesSettings effectiveSettings = settings ?? NodeTemplatesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); _callAggregatedList = clientHelper.BuildApiCall(grpcClient.AggregatedListAsync, grpcClient.AggregatedList, effectiveSettings.AggregatedListSettings).WithGoogleRequestParam("project", request => request.Project); Modify_ApiCall(ref _callAggregatedList); Modify_AggregatedListApiCall(ref _callAggregatedList); @@ -1135,16 +1228,22 @@ public NodeTemplatesClientImpl(NodeTemplates.NodeTemplatesClient grpcClient, Nod return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified NodeTemplate resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteNodeTemplateRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteNodeTemplateRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteNodeTemplateRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1153,10 +1252,13 @@ public override Operation Delete(DeleteNodeTemplateRequest request, gaxgrpc::Cal /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteNodeTemplateRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteNodeTemplateRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteNodeTemplateRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1207,16 +1309,22 @@ public override Policy GetIamPolicy(GetIamPolicyNodeTemplateRequest request, gax return _callGetIamPolicy.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a NodeTemplate resource in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertNodeTemplateRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertNodeTemplateRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertNodeTemplateRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1225,10 +1333,13 @@ public override Operation Insert(InsertNodeTemplateRequest request, gaxgrpc::Cal /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertNodeTemplateRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertNodeTemplateRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertNodeTemplateRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1339,4 +1450,18 @@ public partial class NodeTemplateList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class NodeTemplates + { + public partial class NodeTemplatesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/PacketMirroringsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/PacketMirroringsClient.g.cs index e6c4efae7062..06a74c4cf699 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/PacketMirroringsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/PacketMirroringsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -46,10 +47,13 @@ private PacketMirroringsSettings(PacketMirroringsSettings existing) : base(exist gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); TestIamPermissionsSettings = existing.TestIamPermissionsSettings; OnCopy(existing); } @@ -80,6 +84,24 @@ private PacketMirroringsSettings(PacketMirroringsSettings existing) : base(exist /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to PacketMirroringsClient.Delete and + /// PacketMirroringsClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to PacketMirroringsClient.Get /// and PacketMirroringsClient.GetAsync. @@ -104,6 +126,24 @@ private PacketMirroringsSettings(PacketMirroringsSettings existing) : base(exist /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to PacketMirroringsClient.Insert and + /// PacketMirroringsClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to PacketMirroringsClient.List /// and PacketMirroringsClient.ListAsync. @@ -128,6 +168,24 @@ private PacketMirroringsSettings(PacketMirroringsSettings existing) : base(exist /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to PacketMirroringsClient.Patch and + /// PacketMirroringsClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// PacketMirroringsClient.TestIamPermissions and PacketMirroringsClient.TestIamPermissionsAsync. @@ -379,7 +437,7 @@ internal static PacketMirroringsClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeletePacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeletePacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -388,7 +446,7 @@ internal static PacketMirroringsClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeletePacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeletePacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -397,9 +455,35 @@ internal static PacketMirroringsClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeletePacketMirroringRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeletePacketMirroringRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified PacketMirroring resource. /// @@ -414,7 +498,7 @@ internal static PacketMirroringsClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string packetMirroring, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string packetMirroring, gaxgrpc::CallSettings callSettings = null) => Delete(new DeletePacketMirroringRequest { PacketMirroring = gax::GaxPreconditions.CheckNotNullOrEmpty(packetMirroring, nameof(packetMirroring)), @@ -436,7 +520,7 @@ internal static PacketMirroringsClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string packetMirroring, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string packetMirroring, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeletePacketMirroringRequest { PacketMirroring = gax::GaxPreconditions.CheckNotNullOrEmpty(packetMirroring, nameof(packetMirroring)), @@ -458,7 +542,7 @@ internal static PacketMirroringsClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string packetMirroring, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string packetMirroring, st::CancellationToken cancellationToken) => DeleteAsync(project, region, packetMirroring, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -555,7 +639,7 @@ internal static PacketMirroringsClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertPacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertPacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -564,7 +648,7 @@ internal static PacketMirroringsClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertPacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertPacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -573,9 +657,35 @@ internal static PacketMirroringsClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertPacketMirroringRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertPacketMirroringRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a PacketMirroring resource in the specified project and region using the data included in the request. /// @@ -590,7 +700,7 @@ internal static PacketMirroringsClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, PacketMirroring packetMirroringResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, PacketMirroring packetMirroringResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertPacketMirroringRequest { PacketMirroringResource = gax::GaxPreconditions.CheckNotNull(packetMirroringResource, nameof(packetMirroringResource)), @@ -612,7 +722,7 @@ internal static PacketMirroringsClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, PacketMirroring packetMirroringResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, PacketMirroring packetMirroringResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertPacketMirroringRequest { PacketMirroringResource = gax::GaxPreconditions.CheckNotNull(packetMirroringResource, nameof(packetMirroringResource)), @@ -634,7 +744,7 @@ internal static PacketMirroringsClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, PacketMirroring packetMirroringResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, PacketMirroring packetMirroringResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, packetMirroringResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -717,7 +827,7 @@ internal static PacketMirroringsClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchPacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchPacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -726,7 +836,7 @@ internal static PacketMirroringsClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchPacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchPacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -735,9 +845,35 @@ internal static PacketMirroringsClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchPacketMirroringRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchPacketMirroringRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Patches the specified PacketMirroring resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. /// @@ -755,7 +891,7 @@ internal static PacketMirroringsClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string region, string packetMirroring, PacketMirroring packetMirroringResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string region, string packetMirroring, PacketMirroring packetMirroringResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchPacketMirroringRequest { PacketMirroring = gax::GaxPreconditions.CheckNotNullOrEmpty(packetMirroring, nameof(packetMirroring)), @@ -781,7 +917,7 @@ internal static PacketMirroringsClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, string packetMirroring, PacketMirroring packetMirroringResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string region, string packetMirroring, PacketMirroring packetMirroringResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchPacketMirroringRequest { PacketMirroring = gax::GaxPreconditions.CheckNotNullOrEmpty(packetMirroring, nameof(packetMirroring)), @@ -807,7 +943,7 @@ internal static PacketMirroringsClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, string packetMirroring, PacketMirroring packetMirroringResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string region, string packetMirroring, PacketMirroring packetMirroringResource, st::CancellationToken cancellationToken) => PatchAsync(project, region, packetMirroring, packetMirroringResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -940,6 +1076,9 @@ public PacketMirroringsClientImpl(PacketMirrorings.PacketMirroringsClient grpcCl GrpcClient = grpcClient; PacketMirroringsSettings effectiveSettings = settings ?? PacketMirroringsSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.PatchOperationsSettings); _callAggregatedList = clientHelper.BuildApiCall(grpcClient.AggregatedListAsync, grpcClient.AggregatedList, effectiveSettings.AggregatedListSettings).WithGoogleRequestParam("project", request => request.Project); Modify_ApiCall(ref _callAggregatedList); Modify_AggregatedListApiCall(ref _callAggregatedList); @@ -1025,16 +1164,22 @@ public PacketMirroringsClientImpl(PacketMirrorings.PacketMirroringsClient grpcCl return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified PacketMirroring resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeletePacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeletePacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeletePacketMirroringRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1043,10 +1188,13 @@ public override Operation Delete(DeletePacketMirroringRequest request, gaxgrpc:: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeletePacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeletePacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeletePacketMirroringRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1073,16 +1221,22 @@ public override PacketMirroring Get(GetPacketMirroringRequest request, gaxgrpc:: return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a PacketMirroring resource in the specified project and region using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertPacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertPacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertPacketMirroringRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1091,10 +1245,13 @@ public override Operation Insert(InsertPacketMirroringRequest request, gaxgrpc:: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertPacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertPacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertPacketMirroringRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1121,16 +1278,22 @@ public override Operation Insert(InsertPacketMirroringRequest request, gaxgrpc:: return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Patches the specified PacketMirroring resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchPacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchPacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchPacketMirroringRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1139,10 +1302,13 @@ public override Operation Patch(PatchPacketMirroringRequest request, gaxgrpc::Ca /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchPacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchPacketMirroringRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchPacketMirroringRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1206,4 +1372,18 @@ public partial class PacketMirroringList : gaxgrpc::IPageResponse GetEnumerator(); } + + public static partial class PacketMirrorings + { + public partial class PacketMirroringsClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ProjectsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ProjectsClient.g.cs index a707012cafe9..6091dc6da2e0 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ProjectsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ProjectsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,18 +46,27 @@ private ProjectsSettings(ProjectsSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DisableXpnHostSettings = existing.DisableXpnHostSettings; + DisableXpnHostOperationsSettings = existing.DisableXpnHostOperationsSettings.Clone(); DisableXpnResourceSettings = existing.DisableXpnResourceSettings; + DisableXpnResourceOperationsSettings = existing.DisableXpnResourceOperationsSettings.Clone(); EnableXpnHostSettings = existing.EnableXpnHostSettings; + EnableXpnHostOperationsSettings = existing.EnableXpnHostOperationsSettings.Clone(); EnableXpnResourceSettings = existing.EnableXpnResourceSettings; + EnableXpnResourceOperationsSettings = existing.EnableXpnResourceOperationsSettings.Clone(); GetSettings = existing.GetSettings; GetXpnHostSettings = existing.GetXpnHostSettings; GetXpnResourcesSettings = existing.GetXpnResourcesSettings; ListXpnHostsSettings = existing.ListXpnHostsSettings; MoveDiskSettings = existing.MoveDiskSettings; + MoveDiskOperationsSettings = existing.MoveDiskOperationsSettings.Clone(); MoveInstanceSettings = existing.MoveInstanceSettings; + MoveInstanceOperationsSettings = existing.MoveInstanceOperationsSettings.Clone(); SetCommonInstanceMetadataSettings = existing.SetCommonInstanceMetadataSettings; + SetCommonInstanceMetadataOperationsSettings = existing.SetCommonInstanceMetadataOperationsSettings.Clone(); SetDefaultNetworkTierSettings = existing.SetDefaultNetworkTierSettings; + SetDefaultNetworkTierOperationsSettings = existing.SetDefaultNetworkTierOperationsSettings.Clone(); SetUsageExportBucketSettings = existing.SetUsageExportBucketSettings; + SetUsageExportBucketOperationsSettings = existing.SetUsageExportBucketOperationsSettings.Clone(); OnCopy(existing); } @@ -74,6 +84,24 @@ private ProjectsSettings(ProjectsSettings existing) : base(existing) /// public gaxgrpc::CallSettings DisableXpnHostSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ProjectsClient.DisableXpnHost and + /// ProjectsClient.DisableXpnHostAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DisableXpnHostOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// ProjectsClient.DisableXpnResource and ProjectsClient.DisableXpnResourceAsync. @@ -86,6 +114,24 @@ private ProjectsSettings(ProjectsSettings existing) : base(existing) /// public gaxgrpc::CallSettings DisableXpnResourceSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ProjectsClient.DisableXpnResource and + /// ProjectsClient.DisableXpnResourceAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DisableXpnResourceOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// ProjectsClient.EnableXpnHost and ProjectsClient.EnableXpnHostAsync. @@ -98,6 +144,24 @@ private ProjectsSettings(ProjectsSettings existing) : base(existing) /// public gaxgrpc::CallSettings EnableXpnHostSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ProjectsClient.EnableXpnHost and + /// ProjectsClient.EnableXpnHostAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings EnableXpnHostOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// ProjectsClient.EnableXpnResource and ProjectsClient.EnableXpnResourceAsync. @@ -110,6 +174,24 @@ private ProjectsSettings(ProjectsSettings existing) : base(existing) /// public gaxgrpc::CallSettings EnableXpnResourceSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ProjectsClient.EnableXpnResource and + /// ProjectsClient.EnableXpnResourceAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings EnableXpnResourceOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to ProjectsClient.Get and /// ProjectsClient.GetAsync. @@ -170,6 +252,24 @@ private ProjectsSettings(ProjectsSettings existing) : base(existing) /// public gaxgrpc::CallSettings MoveDiskSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ProjectsClient.MoveDisk and + /// ProjectsClient.MoveDiskAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings MoveDiskOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to ProjectsClient.MoveInstance /// and ProjectsClient.MoveInstanceAsync. @@ -182,6 +282,24 @@ private ProjectsSettings(ProjectsSettings existing) : base(existing) /// public gaxgrpc::CallSettings MoveInstanceSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ProjectsClient.MoveInstance and + /// ProjectsClient.MoveInstanceAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings MoveInstanceOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// ProjectsClient.SetCommonInstanceMetadata and ProjectsClient.SetCommonInstanceMetadataAsync. @@ -194,6 +312,24 @@ private ProjectsSettings(ProjectsSettings existing) : base(existing) /// public gaxgrpc::CallSettings SetCommonInstanceMetadataSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ProjectsClient.SetCommonInstanceMetadata and + /// ProjectsClient.SetCommonInstanceMetadataAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetCommonInstanceMetadataOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// ProjectsClient.SetDefaultNetworkTier and ProjectsClient.SetDefaultNetworkTierAsync. @@ -206,6 +342,24 @@ private ProjectsSettings(ProjectsSettings existing) : base(existing) /// public gaxgrpc::CallSettings SetDefaultNetworkTierSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ProjectsClient.SetDefaultNetworkTier and + /// ProjectsClient.SetDefaultNetworkTierAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetDefaultNetworkTierOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// ProjectsClient.SetUsageExportBucket and ProjectsClient.SetUsageExportBucketAsync. @@ -218,6 +372,24 @@ private ProjectsSettings(ProjectsSettings existing) : base(existing) /// public gaxgrpc::CallSettings SetUsageExportBucketSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ProjectsClient.SetUsageExportBucket and + /// ProjectsClient.SetUsageExportBucketAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetUsageExportBucketOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public ProjectsSettings Clone() => new ProjectsSettings(this); @@ -386,7 +558,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DisableXpnHost(DisableXpnHostProjectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DisableXpnHost(DisableXpnHostProjectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -395,7 +567,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DisableXpnHostAsync(DisableXpnHostProjectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DisableXpnHostAsync(DisableXpnHostProjectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -404,9 +576,35 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DisableXpnHostAsync(DisableXpnHostProjectRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DisableXpnHostAsync(DisableXpnHostProjectRequest request, st::CancellationToken cancellationToken) => DisableXpnHostAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for DisableXpnHost. + public virtual lro::OperationsClient DisableXpnHostOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of DisableXpnHost. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDisableXpnHost(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DisableXpnHostOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// DisableXpnHost. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDisableXpnHostAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DisableXpnHostOperationsClient, callSettings); + /// /// Disable this project as a shared VPC host project. /// @@ -415,7 +613,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DisableXpnHost(string project, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DisableXpnHost(string project, gaxgrpc::CallSettings callSettings = null) => DisableXpnHost(new DisableXpnHostProjectRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -429,7 +627,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DisableXpnHostAsync(string project, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DisableXpnHostAsync(string project, gaxgrpc::CallSettings callSettings = null) => DisableXpnHostAsync(new DisableXpnHostProjectRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -443,7 +641,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DisableXpnHostAsync(string project, st::CancellationToken cancellationToken) => + public virtual stt::Task> DisableXpnHostAsync(string project, st::CancellationToken cancellationToken) => DisableXpnHostAsync(project, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -452,7 +650,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DisableXpnResource(DisableXpnResourceProjectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DisableXpnResource(DisableXpnResourceProjectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -461,7 +659,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DisableXpnResourceAsync(DisableXpnResourceProjectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DisableXpnResourceAsync(DisableXpnResourceProjectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -470,9 +668,36 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DisableXpnResourceAsync(DisableXpnResourceProjectRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DisableXpnResourceAsync(DisableXpnResourceProjectRequest request, st::CancellationToken cancellationToken) => DisableXpnResourceAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for DisableXpnResource. + public virtual lro::OperationsClient DisableXpnResourceOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of DisableXpnResource + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDisableXpnResource(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DisableXpnResourceOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// DisableXpnResource. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDisableXpnResourceAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DisableXpnResourceOperationsClient, callSettings); + /// /// Disable a service resource (also known as service project) associated with this host project. /// @@ -484,7 +709,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DisableXpnResource(string project, ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DisableXpnResource(string project, ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource, gaxgrpc::CallSettings callSettings = null) => DisableXpnResource(new DisableXpnResourceProjectRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -502,7 +727,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DisableXpnResourceAsync(string project, ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DisableXpnResourceAsync(string project, ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource, gaxgrpc::CallSettings callSettings = null) => DisableXpnResourceAsync(new DisableXpnResourceProjectRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -520,7 +745,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DisableXpnResourceAsync(string project, ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> DisableXpnResourceAsync(string project, ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource, st::CancellationToken cancellationToken) => DisableXpnResourceAsync(project, projectsDisableXpnResourceRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -529,7 +754,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation EnableXpnHost(EnableXpnHostProjectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation EnableXpnHost(EnableXpnHostProjectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -538,7 +763,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task EnableXpnHostAsync(EnableXpnHostProjectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> EnableXpnHostAsync(EnableXpnHostProjectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -547,9 +772,35 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task EnableXpnHostAsync(EnableXpnHostProjectRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> EnableXpnHostAsync(EnableXpnHostProjectRequest request, st::CancellationToken cancellationToken) => EnableXpnHostAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for EnableXpnHost. + public virtual lro::OperationsClient EnableXpnHostOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of EnableXpnHost. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceEnableXpnHost(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), EnableXpnHostOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// EnableXpnHost. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceEnableXpnHostAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), EnableXpnHostOperationsClient, callSettings); + /// /// Enable this project as a shared VPC host project. /// @@ -558,7 +809,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation EnableXpnHost(string project, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation EnableXpnHost(string project, gaxgrpc::CallSettings callSettings = null) => EnableXpnHost(new EnableXpnHostProjectRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -572,7 +823,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task EnableXpnHostAsync(string project, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> EnableXpnHostAsync(string project, gaxgrpc::CallSettings callSettings = null) => EnableXpnHostAsync(new EnableXpnHostProjectRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -586,7 +837,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task EnableXpnHostAsync(string project, st::CancellationToken cancellationToken) => + public virtual stt::Task> EnableXpnHostAsync(string project, st::CancellationToken cancellationToken) => EnableXpnHostAsync(project, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -595,7 +846,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation EnableXpnResource(EnableXpnResourceProjectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation EnableXpnResource(EnableXpnResourceProjectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -604,7 +855,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task EnableXpnResourceAsync(EnableXpnResourceProjectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> EnableXpnResourceAsync(EnableXpnResourceProjectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -613,9 +864,36 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task EnableXpnResourceAsync(EnableXpnResourceProjectRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> EnableXpnResourceAsync(EnableXpnResourceProjectRequest request, st::CancellationToken cancellationToken) => EnableXpnResourceAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for EnableXpnResource. + public virtual lro::OperationsClient EnableXpnResourceOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of EnableXpnResource + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceEnableXpnResource(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), EnableXpnResourceOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// EnableXpnResource. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceEnableXpnResourceAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), EnableXpnResourceOperationsClient, callSettings); + /// /// Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project. /// @@ -627,7 +905,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation EnableXpnResource(string project, ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation EnableXpnResource(string project, ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource, gaxgrpc::CallSettings callSettings = null) => EnableXpnResource(new EnableXpnResourceProjectRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -645,7 +923,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task EnableXpnResourceAsync(string project, ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> EnableXpnResourceAsync(string project, ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource, gaxgrpc::CallSettings callSettings = null) => EnableXpnResourceAsync(new EnableXpnResourceProjectRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -663,7 +941,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task EnableXpnResourceAsync(string project, ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> EnableXpnResourceAsync(string project, ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource, st::CancellationToken cancellationToken) => EnableXpnResourceAsync(project, projectsEnableXpnResourceRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -944,7 +1222,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation MoveDisk(MoveDiskProjectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation MoveDisk(MoveDiskProjectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -953,7 +1231,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task MoveDiskAsync(MoveDiskProjectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> MoveDiskAsync(MoveDiskProjectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -962,9 +1240,35 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task MoveDiskAsync(MoveDiskProjectRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> MoveDiskAsync(MoveDiskProjectRequest request, st::CancellationToken cancellationToken) => MoveDiskAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for MoveDisk. + public virtual lro::OperationsClient MoveDiskOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of MoveDisk. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceMoveDisk(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), MoveDiskOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// MoveDisk. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceMoveDiskAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), MoveDiskOperationsClient, callSettings); + /// /// Moves a persistent disk from one zone to another. /// @@ -976,7 +1280,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation MoveDisk(string project, DiskMoveRequest diskMoveRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation MoveDisk(string project, DiskMoveRequest diskMoveRequestResource, gaxgrpc::CallSettings callSettings = null) => MoveDisk(new MoveDiskProjectRequest { DiskMoveRequestResource = gax::GaxPreconditions.CheckNotNull(diskMoveRequestResource, nameof(diskMoveRequestResource)), @@ -994,7 +1298,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task MoveDiskAsync(string project, DiskMoveRequest diskMoveRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> MoveDiskAsync(string project, DiskMoveRequest diskMoveRequestResource, gaxgrpc::CallSettings callSettings = null) => MoveDiskAsync(new MoveDiskProjectRequest { DiskMoveRequestResource = gax::GaxPreconditions.CheckNotNull(diskMoveRequestResource, nameof(diskMoveRequestResource)), @@ -1012,7 +1316,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task MoveDiskAsync(string project, DiskMoveRequest diskMoveRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> MoveDiskAsync(string project, DiskMoveRequest diskMoveRequestResource, st::CancellationToken cancellationToken) => MoveDiskAsync(project, diskMoveRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1021,7 +1325,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation MoveInstance(MoveInstanceProjectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation MoveInstance(MoveInstanceProjectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1030,7 +1334,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task MoveInstanceAsync(MoveInstanceProjectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> MoveInstanceAsync(MoveInstanceProjectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1039,9 +1343,35 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task MoveInstanceAsync(MoveInstanceProjectRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> MoveInstanceAsync(MoveInstanceProjectRequest request, st::CancellationToken cancellationToken) => MoveInstanceAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for MoveInstance. + public virtual lro::OperationsClient MoveInstanceOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of MoveInstance. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceMoveInstance(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), MoveInstanceOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// MoveInstance. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceMoveInstanceAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), MoveInstanceOperationsClient, callSettings); + /// /// Moves an instance and its attached persistent disks from one zone to another. /// @@ -1053,7 +1383,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation MoveInstance(string project, InstanceMoveRequest instanceMoveRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation MoveInstance(string project, InstanceMoveRequest instanceMoveRequestResource, gaxgrpc::CallSettings callSettings = null) => MoveInstance(new MoveInstanceProjectRequest { InstanceMoveRequestResource = gax::GaxPreconditions.CheckNotNull(instanceMoveRequestResource, nameof(instanceMoveRequestResource)), @@ -1071,7 +1401,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task MoveInstanceAsync(string project, InstanceMoveRequest instanceMoveRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> MoveInstanceAsync(string project, InstanceMoveRequest instanceMoveRequestResource, gaxgrpc::CallSettings callSettings = null) => MoveInstanceAsync(new MoveInstanceProjectRequest { InstanceMoveRequestResource = gax::GaxPreconditions.CheckNotNull(instanceMoveRequestResource, nameof(instanceMoveRequestResource)), @@ -1089,7 +1419,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task MoveInstanceAsync(string project, InstanceMoveRequest instanceMoveRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> MoveInstanceAsync(string project, InstanceMoveRequest instanceMoveRequestResource, st::CancellationToken cancellationToken) => MoveInstanceAsync(project, instanceMoveRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1098,7 +1428,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetCommonInstanceMetadata(SetCommonInstanceMetadataProjectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetCommonInstanceMetadata(SetCommonInstanceMetadataProjectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1107,7 +1437,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetCommonInstanceMetadataAsync(SetCommonInstanceMetadataProjectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetCommonInstanceMetadataAsync(SetCommonInstanceMetadataProjectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1116,9 +1446,36 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetCommonInstanceMetadataAsync(SetCommonInstanceMetadataProjectRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetCommonInstanceMetadataAsync(SetCommonInstanceMetadataProjectRequest request, st::CancellationToken cancellationToken) => SetCommonInstanceMetadataAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetCommonInstanceMetadata. + public virtual lro::OperationsClient SetCommonInstanceMetadataOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of + /// SetCommonInstanceMetadata. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetCommonInstanceMetadata(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetCommonInstanceMetadataOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetCommonInstanceMetadata. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetCommonInstanceMetadataAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetCommonInstanceMetadataOperationsClient, callSettings); + /// /// Sets metadata common to all instances within the specified project using the data included in the request. /// @@ -1130,7 +1487,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetCommonInstanceMetadata(string project, Metadata metadataResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetCommonInstanceMetadata(string project, Metadata metadataResource, gaxgrpc::CallSettings callSettings = null) => SetCommonInstanceMetadata(new SetCommonInstanceMetadataProjectRequest { MetadataResource = gax::GaxPreconditions.CheckNotNull(metadataResource, nameof(metadataResource)), @@ -1148,7 +1505,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetCommonInstanceMetadataAsync(string project, Metadata metadataResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetCommonInstanceMetadataAsync(string project, Metadata metadataResource, gaxgrpc::CallSettings callSettings = null) => SetCommonInstanceMetadataAsync(new SetCommonInstanceMetadataProjectRequest { MetadataResource = gax::GaxPreconditions.CheckNotNull(metadataResource, nameof(metadataResource)), @@ -1166,7 +1523,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetCommonInstanceMetadataAsync(string project, Metadata metadataResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetCommonInstanceMetadataAsync(string project, Metadata metadataResource, st::CancellationToken cancellationToken) => SetCommonInstanceMetadataAsync(project, metadataResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1175,7 +1532,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetDefaultNetworkTier(SetDefaultNetworkTierProjectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetDefaultNetworkTier(SetDefaultNetworkTierProjectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1184,7 +1541,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetDefaultNetworkTierAsync(SetDefaultNetworkTierProjectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetDefaultNetworkTierAsync(SetDefaultNetworkTierProjectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1193,9 +1550,36 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetDefaultNetworkTierAsync(SetDefaultNetworkTierProjectRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetDefaultNetworkTierAsync(SetDefaultNetworkTierProjectRequest request, st::CancellationToken cancellationToken) => SetDefaultNetworkTierAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetDefaultNetworkTier. + public virtual lro::OperationsClient SetDefaultNetworkTierOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetDefaultNetworkTier + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetDefaultNetworkTier(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetDefaultNetworkTierOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetDefaultNetworkTier. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetDefaultNetworkTierAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetDefaultNetworkTierOperationsClient, callSettings); + /// /// Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field. /// @@ -1207,7 +1591,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetDefaultNetworkTier(string project, ProjectsSetDefaultNetworkTierRequest projectsSetDefaultNetworkTierRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetDefaultNetworkTier(string project, ProjectsSetDefaultNetworkTierRequest projectsSetDefaultNetworkTierRequestResource, gaxgrpc::CallSettings callSettings = null) => SetDefaultNetworkTier(new SetDefaultNetworkTierProjectRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1225,7 +1609,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetDefaultNetworkTierAsync(string project, ProjectsSetDefaultNetworkTierRequest projectsSetDefaultNetworkTierRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetDefaultNetworkTierAsync(string project, ProjectsSetDefaultNetworkTierRequest projectsSetDefaultNetworkTierRequestResource, gaxgrpc::CallSettings callSettings = null) => SetDefaultNetworkTierAsync(new SetDefaultNetworkTierProjectRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1243,7 +1627,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetDefaultNetworkTierAsync(string project, ProjectsSetDefaultNetworkTierRequest projectsSetDefaultNetworkTierRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetDefaultNetworkTierAsync(string project, ProjectsSetDefaultNetworkTierRequest projectsSetDefaultNetworkTierRequestResource, st::CancellationToken cancellationToken) => SetDefaultNetworkTierAsync(project, projectsSetDefaultNetworkTierRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1252,7 +1636,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetUsageExportBucket(SetUsageExportBucketProjectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetUsageExportBucket(SetUsageExportBucketProjectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1261,7 +1645,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetUsageExportBucketAsync(SetUsageExportBucketProjectRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetUsageExportBucketAsync(SetUsageExportBucketProjectRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1270,9 +1654,36 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetUsageExportBucketAsync(SetUsageExportBucketProjectRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetUsageExportBucketAsync(SetUsageExportBucketProjectRequest request, st::CancellationToken cancellationToken) => SetUsageExportBucketAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetUsageExportBucket. + public virtual lro::OperationsClient SetUsageExportBucketOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetUsageExportBucket + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetUsageExportBucket(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetUsageExportBucketOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetUsageExportBucket. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetUsageExportBucketAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetUsageExportBucketOperationsClient, callSettings); + /// /// Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled. /// @@ -1284,7 +1695,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetUsageExportBucket(string project, UsageExportLocation usageExportLocationResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetUsageExportBucket(string project, UsageExportLocation usageExportLocationResource, gaxgrpc::CallSettings callSettings = null) => SetUsageExportBucket(new SetUsageExportBucketProjectRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1302,7 +1713,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetUsageExportBucketAsync(string project, UsageExportLocation usageExportLocationResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetUsageExportBucketAsync(string project, UsageExportLocation usageExportLocationResource, gaxgrpc::CallSettings callSettings = null) => SetUsageExportBucketAsync(new SetUsageExportBucketProjectRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1320,7 +1731,7 @@ internal static ProjectsClient Create(grpccore::CallInvoker callInvoker, Project /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetUsageExportBucketAsync(string project, UsageExportLocation usageExportLocationResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetUsageExportBucketAsync(string project, UsageExportLocation usageExportLocationResource, st::CancellationToken cancellationToken) => SetUsageExportBucketAsync(project, usageExportLocationResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -1366,6 +1777,15 @@ public ProjectsClientImpl(Projects.ProjectsClient grpcClient, ProjectsSettings s GrpcClient = grpcClient; ProjectsSettings effectiveSettings = settings ?? ProjectsSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DisableXpnHostOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DisableXpnHostOperationsSettings); + DisableXpnResourceOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DisableXpnResourceOperationsSettings); + EnableXpnHostOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.EnableXpnHostOperationsSettings); + EnableXpnResourceOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.EnableXpnResourceOperationsSettings); + MoveDiskOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.MoveDiskOperationsSettings); + MoveInstanceOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.MoveInstanceOperationsSettings); + SetCommonInstanceMetadataOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.SetCommonInstanceMetadataOperationsSettings); + SetDefaultNetworkTierOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.SetDefaultNetworkTierOperationsSettings); + SetUsageExportBucketOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.SetUsageExportBucketOperationsSettings); _callDisableXpnHost = clientHelper.BuildApiCall(grpcClient.DisableXpnHostAsync, grpcClient.DisableXpnHost, effectiveSettings.DisableXpnHostSettings).WithGoogleRequestParam("project", request => request.Project); Modify_ApiCall(ref _callDisableXpnHost); Modify_DisableXpnHostApiCall(ref _callDisableXpnHost); @@ -1467,16 +1887,22 @@ public ProjectsClientImpl(Projects.ProjectsClient grpcClient, ProjectsSettings s partial void Modify_SetUsageExportBucketProjectRequest(ref SetUsageExportBucketProjectRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for DisableXpnHost. + public override lro::OperationsClient DisableXpnHostOperationsClient { get; } + /// /// Disable this project as a shared VPC host project. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation DisableXpnHost(DisableXpnHostProjectRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation DisableXpnHost(DisableXpnHostProjectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DisableXpnHostProjectRequest(ref request, ref callSettings); - return _callDisableXpnHost.Sync(request, callSettings); + Operation response = _callDisableXpnHost.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DisableXpnHostOperationsClient); } /// @@ -1485,22 +1911,31 @@ public override Operation DisableXpnHost(DisableXpnHostProjectRequest request, g /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DisableXpnHostAsync(DisableXpnHostProjectRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DisableXpnHostAsync(DisableXpnHostProjectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DisableXpnHostProjectRequest(ref request, ref callSettings); - return _callDisableXpnHost.Async(request, callSettings); + Operation response = await _callDisableXpnHost.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DisableXpnHostOperationsClient); } + /// The long-running operations client for DisableXpnResource. + public override lro::OperationsClient DisableXpnResourceOperationsClient { get; } + /// /// Disable a service resource (also known as service project) associated with this host project. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation DisableXpnResource(DisableXpnResourceProjectRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation DisableXpnResource(DisableXpnResourceProjectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DisableXpnResourceProjectRequest(ref request, ref callSettings); - return _callDisableXpnResource.Sync(request, callSettings); + Operation response = _callDisableXpnResource.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DisableXpnResourceOperationsClient); } /// @@ -1509,22 +1944,31 @@ public override Operation DisableXpnResource(DisableXpnResourceProjectRequest re /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DisableXpnResourceAsync(DisableXpnResourceProjectRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DisableXpnResourceAsync(DisableXpnResourceProjectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DisableXpnResourceProjectRequest(ref request, ref callSettings); - return _callDisableXpnResource.Async(request, callSettings); + Operation response = await _callDisableXpnResource.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DisableXpnResourceOperationsClient); } + /// The long-running operations client for EnableXpnHost. + public override lro::OperationsClient EnableXpnHostOperationsClient { get; } + /// /// Enable this project as a shared VPC host project. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation EnableXpnHost(EnableXpnHostProjectRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation EnableXpnHost(EnableXpnHostProjectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_EnableXpnHostProjectRequest(ref request, ref callSettings); - return _callEnableXpnHost.Sync(request, callSettings); + Operation response = _callEnableXpnHost.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), EnableXpnHostOperationsClient); } /// @@ -1533,22 +1977,31 @@ public override Operation EnableXpnHost(EnableXpnHostProjectRequest request, gax /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task EnableXpnHostAsync(EnableXpnHostProjectRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> EnableXpnHostAsync(EnableXpnHostProjectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_EnableXpnHostProjectRequest(ref request, ref callSettings); - return _callEnableXpnHost.Async(request, callSettings); + Operation response = await _callEnableXpnHost.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), EnableXpnHostOperationsClient); } + /// The long-running operations client for EnableXpnResource. + public override lro::OperationsClient EnableXpnResourceOperationsClient { get; } + /// /// Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation EnableXpnResource(EnableXpnResourceProjectRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation EnableXpnResource(EnableXpnResourceProjectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_EnableXpnResourceProjectRequest(ref request, ref callSettings); - return _callEnableXpnResource.Sync(request, callSettings); + Operation response = _callEnableXpnResource.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), EnableXpnResourceOperationsClient); } /// @@ -1557,10 +2010,13 @@ public override Operation EnableXpnResource(EnableXpnResourceProjectRequest requ /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task EnableXpnResourceAsync(EnableXpnResourceProjectRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> EnableXpnResourceAsync(EnableXpnResourceProjectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_EnableXpnResourceProjectRequest(ref request, ref callSettings); - return _callEnableXpnResource.Async(request, callSettings); + Operation response = await _callEnableXpnResource.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), EnableXpnResourceOperationsClient); } /// @@ -1659,16 +2115,22 @@ public override Project GetXpnHost(GetXpnHostProjectRequest request, gaxgrpc::Ca return new gaxgrpc::GrpcPagedAsyncEnumerable(_callListXpnHosts, request, callSettings); } + /// The long-running operations client for MoveDisk. + public override lro::OperationsClient MoveDiskOperationsClient { get; } + /// /// Moves a persistent disk from one zone to another. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation MoveDisk(MoveDiskProjectRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation MoveDisk(MoveDiskProjectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_MoveDiskProjectRequest(ref request, ref callSettings); - return _callMoveDisk.Sync(request, callSettings); + Operation response = _callMoveDisk.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), MoveDiskOperationsClient); } /// @@ -1677,22 +2139,31 @@ public override Operation MoveDisk(MoveDiskProjectRequest request, gaxgrpc::Call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task MoveDiskAsync(MoveDiskProjectRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> MoveDiskAsync(MoveDiskProjectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_MoveDiskProjectRequest(ref request, ref callSettings); - return _callMoveDisk.Async(request, callSettings); + Operation response = await _callMoveDisk.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), MoveDiskOperationsClient); } + /// The long-running operations client for MoveInstance. + public override lro::OperationsClient MoveInstanceOperationsClient { get; } + /// /// Moves an instance and its attached persistent disks from one zone to another. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation MoveInstance(MoveInstanceProjectRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation MoveInstance(MoveInstanceProjectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_MoveInstanceProjectRequest(ref request, ref callSettings); - return _callMoveInstance.Sync(request, callSettings); + Operation response = _callMoveInstance.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), MoveInstanceOperationsClient); } /// @@ -1701,22 +2172,31 @@ public override Operation MoveInstance(MoveInstanceProjectRequest request, gaxgr /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task MoveInstanceAsync(MoveInstanceProjectRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> MoveInstanceAsync(MoveInstanceProjectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_MoveInstanceProjectRequest(ref request, ref callSettings); - return _callMoveInstance.Async(request, callSettings); + Operation response = await _callMoveInstance.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), MoveInstanceOperationsClient); } + /// The long-running operations client for SetCommonInstanceMetadata. + public override lro::OperationsClient SetCommonInstanceMetadataOperationsClient { get; } + /// /// Sets metadata common to all instances within the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetCommonInstanceMetadata(SetCommonInstanceMetadataProjectRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetCommonInstanceMetadata(SetCommonInstanceMetadataProjectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetCommonInstanceMetadataProjectRequest(ref request, ref callSettings); - return _callSetCommonInstanceMetadata.Sync(request, callSettings); + Operation response = _callSetCommonInstanceMetadata.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetCommonInstanceMetadataOperationsClient); } /// @@ -1725,22 +2205,31 @@ public override Operation SetCommonInstanceMetadata(SetCommonInstanceMetadataPro /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetCommonInstanceMetadataAsync(SetCommonInstanceMetadataProjectRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetCommonInstanceMetadataAsync(SetCommonInstanceMetadataProjectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetCommonInstanceMetadataProjectRequest(ref request, ref callSettings); - return _callSetCommonInstanceMetadata.Async(request, callSettings); + Operation response = await _callSetCommonInstanceMetadata.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetCommonInstanceMetadataOperationsClient); } + /// The long-running operations client for SetDefaultNetworkTier. + public override lro::OperationsClient SetDefaultNetworkTierOperationsClient { get; } + /// /// Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetDefaultNetworkTier(SetDefaultNetworkTierProjectRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetDefaultNetworkTier(SetDefaultNetworkTierProjectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetDefaultNetworkTierProjectRequest(ref request, ref callSettings); - return _callSetDefaultNetworkTier.Sync(request, callSettings); + Operation response = _callSetDefaultNetworkTier.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetDefaultNetworkTierOperationsClient); } /// @@ -1749,22 +2238,31 @@ public override Operation SetDefaultNetworkTier(SetDefaultNetworkTierProjectRequ /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetDefaultNetworkTierAsync(SetDefaultNetworkTierProjectRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetDefaultNetworkTierAsync(SetDefaultNetworkTierProjectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetDefaultNetworkTierProjectRequest(ref request, ref callSettings); - return _callSetDefaultNetworkTier.Async(request, callSettings); + Operation response = await _callSetDefaultNetworkTier.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetDefaultNetworkTierOperationsClient); } + /// The long-running operations client for SetUsageExportBucket. + public override lro::OperationsClient SetUsageExportBucketOperationsClient { get; } + /// /// Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetUsageExportBucket(SetUsageExportBucketProjectRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetUsageExportBucket(SetUsageExportBucketProjectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetUsageExportBucketProjectRequest(ref request, ref callSettings); - return _callSetUsageExportBucket.Sync(request, callSettings); + Operation response = _callSetUsageExportBucket.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetUsageExportBucketOperationsClient); } /// @@ -1773,10 +2271,13 @@ public override Operation SetUsageExportBucket(SetUsageExportBucketProjectReques /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetUsageExportBucketAsync(SetUsageExportBucketProjectRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetUsageExportBucketAsync(SetUsageExportBucketProjectRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetUsageExportBucketProjectRequest(ref request, ref callSettings); - return _callSetUsageExportBucket.Async(request, callSettings); + Operation response = await _callSetUsageExportBucket.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetUsageExportBucketOperationsClient); } } @@ -1815,4 +2316,18 @@ public partial class XpnHostList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class Projects + { + public partial class ProjectsClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/PublicAdvertisedPrefixesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/PublicAdvertisedPrefixesClient.g.cs index 87110acf992b..96117c936f2d 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/PublicAdvertisedPrefixesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/PublicAdvertisedPrefixesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -47,10 +48,13 @@ private PublicAdvertisedPrefixesSettings(PublicAdvertisedPrefixesSettings existi { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); OnCopy(existing); } @@ -68,6 +72,24 @@ private PublicAdvertisedPrefixesSettings(PublicAdvertisedPrefixesSettings existi /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to PublicAdvertisedPrefixesClient.Delete and + /// PublicAdvertisedPrefixesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// PublicAdvertisedPrefixesClient.Get and PublicAdvertisedPrefixesClient.GetAsync. @@ -92,6 +114,24 @@ private PublicAdvertisedPrefixesSettings(PublicAdvertisedPrefixesSettings existi /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to PublicAdvertisedPrefixesClient.Insert and + /// PublicAdvertisedPrefixesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// PublicAdvertisedPrefixesClient.List and PublicAdvertisedPrefixesClient.ListAsync. @@ -116,6 +156,24 @@ private PublicAdvertisedPrefixesSettings(PublicAdvertisedPrefixesSettings existi /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to PublicAdvertisedPrefixesClient.Patch and + /// PublicAdvertisedPrefixesClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public PublicAdvertisedPrefixesSettings Clone() => new PublicAdvertisedPrefixesSettings(this); @@ -288,7 +346,7 @@ internal static PublicAdvertisedPrefixesClient Create(grpccore::CallInvoker call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeletePublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeletePublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -297,7 +355,7 @@ internal static PublicAdvertisedPrefixesClient Create(grpccore::CallInvoker call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeletePublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeletePublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -306,9 +364,35 @@ internal static PublicAdvertisedPrefixesClient Create(grpccore::CallInvoker call /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeletePublicAdvertisedPrefixeRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeletePublicAdvertisedPrefixeRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified PublicAdvertisedPrefix /// @@ -320,7 +404,7 @@ internal static PublicAdvertisedPrefixesClient Create(grpccore::CallInvoker call /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string publicAdvertisedPrefix, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string publicAdvertisedPrefix, gaxgrpc::CallSettings callSettings = null) => Delete(new DeletePublicAdvertisedPrefixeRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -338,7 +422,7 @@ internal static PublicAdvertisedPrefixesClient Create(grpccore::CallInvoker call /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string publicAdvertisedPrefix, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string publicAdvertisedPrefix, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeletePublicAdvertisedPrefixeRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -356,7 +440,7 @@ internal static PublicAdvertisedPrefixesClient Create(grpccore::CallInvoker call /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string publicAdvertisedPrefix, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string publicAdvertisedPrefix, st::CancellationToken cancellationToken) => DeleteAsync(project, publicAdvertisedPrefix, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -442,7 +526,7 @@ internal static PublicAdvertisedPrefixesClient Create(grpccore::CallInvoker call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertPublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertPublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -451,7 +535,7 @@ internal static PublicAdvertisedPrefixesClient Create(grpccore::CallInvoker call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertPublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertPublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -460,9 +544,35 @@ internal static PublicAdvertisedPrefixesClient Create(grpccore::CallInvoker call /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertPublicAdvertisedPrefixeRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertPublicAdvertisedPrefixeRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a PublicAdvertisedPrefix in the specified project using the parameters that are included in the request. /// @@ -474,7 +584,7 @@ internal static PublicAdvertisedPrefixesClient Create(grpccore::CallInvoker call /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, PublicAdvertisedPrefix publicAdvertisedPrefixResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, PublicAdvertisedPrefix publicAdvertisedPrefixResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertPublicAdvertisedPrefixeRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -492,7 +602,7 @@ internal static PublicAdvertisedPrefixesClient Create(grpccore::CallInvoker call /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, PublicAdvertisedPrefix publicAdvertisedPrefixResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, PublicAdvertisedPrefix publicAdvertisedPrefixResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertPublicAdvertisedPrefixeRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -510,7 +620,7 @@ internal static PublicAdvertisedPrefixesClient Create(grpccore::CallInvoker call /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, PublicAdvertisedPrefix publicAdvertisedPrefixResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, PublicAdvertisedPrefix publicAdvertisedPrefixResource, st::CancellationToken cancellationToken) => InsertAsync(project, publicAdvertisedPrefixResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -585,7 +695,7 @@ internal static PublicAdvertisedPrefixesClient Create(grpccore::CallInvoker call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchPublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchPublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -594,7 +704,7 @@ internal static PublicAdvertisedPrefixesClient Create(grpccore::CallInvoker call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchPublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchPublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -603,9 +713,35 @@ internal static PublicAdvertisedPrefixesClient Create(grpccore::CallInvoker call /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchPublicAdvertisedPrefixeRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchPublicAdvertisedPrefixeRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. /// @@ -620,7 +756,7 @@ internal static PublicAdvertisedPrefixesClient Create(grpccore::CallInvoker call /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string publicAdvertisedPrefix, PublicAdvertisedPrefix publicAdvertisedPrefixResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string publicAdvertisedPrefix, PublicAdvertisedPrefix publicAdvertisedPrefixResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchPublicAdvertisedPrefixeRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -642,7 +778,7 @@ internal static PublicAdvertisedPrefixesClient Create(grpccore::CallInvoker call /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string publicAdvertisedPrefix, PublicAdvertisedPrefix publicAdvertisedPrefixResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string publicAdvertisedPrefix, PublicAdvertisedPrefix publicAdvertisedPrefixResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchPublicAdvertisedPrefixeRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -664,7 +800,7 @@ internal static PublicAdvertisedPrefixesClient Create(grpccore::CallInvoker call /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string publicAdvertisedPrefix, PublicAdvertisedPrefix publicAdvertisedPrefixResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string publicAdvertisedPrefix, PublicAdvertisedPrefix publicAdvertisedPrefixResource, st::CancellationToken cancellationToken) => PatchAsync(project, publicAdvertisedPrefix, publicAdvertisedPrefixResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -697,6 +833,9 @@ public PublicAdvertisedPrefixesClientImpl(PublicAdvertisedPrefixes.PublicAdverti GrpcClient = grpcClient; PublicAdvertisedPrefixesSettings effectiveSettings = settings ?? PublicAdvertisedPrefixesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.PatchOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("public_advertised_prefix", request => request.PublicAdvertisedPrefix); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -742,16 +881,22 @@ public PublicAdvertisedPrefixesClientImpl(PublicAdvertisedPrefixes.PublicAdverti partial void Modify_PatchPublicAdvertisedPrefixeRequest(ref PatchPublicAdvertisedPrefixeRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified PublicAdvertisedPrefix /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeletePublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeletePublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeletePublicAdvertisedPrefixeRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -760,10 +905,13 @@ public override Operation Delete(DeletePublicAdvertisedPrefixeRequest request, g /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeletePublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeletePublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeletePublicAdvertisedPrefixeRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -790,16 +938,22 @@ public override PublicAdvertisedPrefix Get(GetPublicAdvertisedPrefixeRequest req return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a PublicAdvertisedPrefix in the specified project using the parameters that are included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertPublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertPublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertPublicAdvertisedPrefixeRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -808,10 +962,13 @@ public override Operation Insert(InsertPublicAdvertisedPrefixeRequest request, g /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertPublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertPublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertPublicAdvertisedPrefixeRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -838,16 +995,22 @@ public override Operation Insert(InsertPublicAdvertisedPrefixeRequest request, g return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchPublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchPublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchPublicAdvertisedPrefixeRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -856,10 +1019,13 @@ public override Operation Patch(PatchPublicAdvertisedPrefixeRequest request, gax /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchPublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchPublicAdvertisedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchPublicAdvertisedPrefixeRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } } @@ -880,4 +1046,18 @@ public partial class PublicAdvertisedPrefixList : gaxgrpc::IPageResponse GetEnumerator(); } + + public static partial class PublicAdvertisedPrefixes + { + public partial class PublicAdvertisedPrefixesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/PublicDelegatedPrefixesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/PublicDelegatedPrefixesClient.g.cs index a3abbf32da0f..f30d5da68efb 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/PublicDelegatedPrefixesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/PublicDelegatedPrefixesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -48,10 +49,13 @@ private PublicDelegatedPrefixesSettings(PublicDelegatedPrefixesSettings existing gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); OnCopy(existing); } @@ -82,6 +86,24 @@ private PublicDelegatedPrefixesSettings(PublicDelegatedPrefixesSettings existing /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to PublicDelegatedPrefixesClient.Delete and + /// PublicDelegatedPrefixesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// PublicDelegatedPrefixesClient.Get and PublicDelegatedPrefixesClient.GetAsync. @@ -106,6 +128,24 @@ private PublicDelegatedPrefixesSettings(PublicDelegatedPrefixesSettings existing /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to PublicDelegatedPrefixesClient.Insert and + /// PublicDelegatedPrefixesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// PublicDelegatedPrefixesClient.List and PublicDelegatedPrefixesClient.ListAsync. @@ -130,6 +170,24 @@ private PublicDelegatedPrefixesSettings(PublicDelegatedPrefixesSettings existing /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to PublicDelegatedPrefixesClient.Patch and + /// PublicDelegatedPrefixesClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public PublicDelegatedPrefixesSettings Clone() => new PublicDelegatedPrefixesSettings(this); @@ -372,7 +430,7 @@ internal static PublicDelegatedPrefixesClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeletePublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeletePublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -381,7 +439,7 @@ internal static PublicDelegatedPrefixesClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeletePublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeletePublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -390,9 +448,35 @@ internal static PublicDelegatedPrefixesClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeletePublicDelegatedPrefixeRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeletePublicDelegatedPrefixeRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified PublicDelegatedPrefix in the given region. /// @@ -407,7 +491,7 @@ internal static PublicDelegatedPrefixesClient Create(grpccore::CallInvoker callI /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string publicDelegatedPrefix, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string publicDelegatedPrefix, gaxgrpc::CallSettings callSettings = null) => Delete(new DeletePublicDelegatedPrefixeRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -429,7 +513,7 @@ internal static PublicDelegatedPrefixesClient Create(grpccore::CallInvoker callI /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string publicDelegatedPrefix, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string publicDelegatedPrefix, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeletePublicDelegatedPrefixeRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -451,7 +535,7 @@ internal static PublicDelegatedPrefixesClient Create(grpccore::CallInvoker callI /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string publicDelegatedPrefix, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string publicDelegatedPrefix, st::CancellationToken cancellationToken) => DeleteAsync(project, region, publicDelegatedPrefix, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -548,7 +632,7 @@ internal static PublicDelegatedPrefixesClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -557,7 +641,7 @@ internal static PublicDelegatedPrefixesClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -566,9 +650,35 @@ internal static PublicDelegatedPrefixesClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertPublicDelegatedPrefixeRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertPublicDelegatedPrefixeRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a PublicDelegatedPrefix in the specified project in the given region using the parameters that are included in the request. /// @@ -583,7 +693,7 @@ internal static PublicDelegatedPrefixesClient Create(grpccore::CallInvoker callI /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, PublicDelegatedPrefix publicDelegatedPrefixResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, PublicDelegatedPrefix publicDelegatedPrefixResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertPublicDelegatedPrefixeRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -605,7 +715,7 @@ internal static PublicDelegatedPrefixesClient Create(grpccore::CallInvoker callI /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, PublicDelegatedPrefix publicDelegatedPrefixResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, PublicDelegatedPrefix publicDelegatedPrefixResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertPublicDelegatedPrefixeRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -627,7 +737,7 @@ internal static PublicDelegatedPrefixesClient Create(grpccore::CallInvoker callI /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, PublicDelegatedPrefix publicDelegatedPrefixResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, PublicDelegatedPrefix publicDelegatedPrefixResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, publicDelegatedPrefixResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -710,7 +820,7 @@ internal static PublicDelegatedPrefixesClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -719,7 +829,7 @@ internal static PublicDelegatedPrefixesClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -728,9 +838,35 @@ internal static PublicDelegatedPrefixesClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchPublicDelegatedPrefixeRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchPublicDelegatedPrefixeRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Patches the specified PublicDelegatedPrefix resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. /// @@ -748,7 +884,7 @@ internal static PublicDelegatedPrefixesClient Create(grpccore::CallInvoker callI /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string region, string publicDelegatedPrefix, PublicDelegatedPrefix publicDelegatedPrefixResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string region, string publicDelegatedPrefix, PublicDelegatedPrefix publicDelegatedPrefixResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchPublicDelegatedPrefixeRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -774,7 +910,7 @@ internal static PublicDelegatedPrefixesClient Create(grpccore::CallInvoker callI /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, string publicDelegatedPrefix, PublicDelegatedPrefix publicDelegatedPrefixResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string region, string publicDelegatedPrefix, PublicDelegatedPrefix publicDelegatedPrefixResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchPublicDelegatedPrefixeRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -800,7 +936,7 @@ internal static PublicDelegatedPrefixesClient Create(grpccore::CallInvoker callI /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, string publicDelegatedPrefix, PublicDelegatedPrefix publicDelegatedPrefixResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string region, string publicDelegatedPrefix, PublicDelegatedPrefix publicDelegatedPrefixResource, st::CancellationToken cancellationToken) => PatchAsync(project, region, publicDelegatedPrefix, publicDelegatedPrefixResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -835,6 +971,9 @@ public PublicDelegatedPrefixesClientImpl(PublicDelegatedPrefixes.PublicDelegated GrpcClient = grpcClient; PublicDelegatedPrefixesSettings effectiveSettings = settings ?? PublicDelegatedPrefixesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.PatchOperationsSettings); _callAggregatedList = clientHelper.BuildApiCall(grpcClient.AggregatedListAsync, grpcClient.AggregatedList, effectiveSettings.AggregatedListSettings).WithGoogleRequestParam("project", request => request.Project); Modify_ApiCall(ref _callAggregatedList); Modify_AggregatedListApiCall(ref _callAggregatedList); @@ -913,16 +1052,22 @@ public PublicDelegatedPrefixesClientImpl(PublicDelegatedPrefixes.PublicDelegated return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified PublicDelegatedPrefix in the given region. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeletePublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeletePublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeletePublicDelegatedPrefixeRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -931,10 +1076,13 @@ public override Operation Delete(DeletePublicDelegatedPrefixeRequest request, ga /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeletePublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeletePublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeletePublicDelegatedPrefixeRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -961,16 +1109,22 @@ public override PublicDelegatedPrefix Get(GetPublicDelegatedPrefixeRequest reque return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a PublicDelegatedPrefix in the specified project in the given region using the parameters that are included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertPublicDelegatedPrefixeRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -979,10 +1133,13 @@ public override Operation Insert(InsertPublicDelegatedPrefixeRequest request, ga /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertPublicDelegatedPrefixeRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1009,16 +1166,22 @@ public override Operation Insert(InsertPublicDelegatedPrefixeRequest request, ga return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Patches the specified PublicDelegatedPrefix resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchPublicDelegatedPrefixeRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1027,10 +1190,13 @@ public override Operation Patch(PatchPublicDelegatedPrefixeRequest request, gaxg /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchPublicDelegatedPrefixeRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchPublicDelegatedPrefixeRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } } @@ -1062,4 +1228,18 @@ public partial class PublicDelegatedPrefixAggregatedList : gaxgrpc::IPageRespons sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class PublicDelegatedPrefixes + { + public partial class PublicDelegatedPrefixesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionAutoscalersClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionAutoscalersClient.g.cs index fea20034a57f..1dfb221598c7 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionAutoscalersClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionAutoscalersClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,11 +46,15 @@ private RegionAutoscalersSettings(RegionAutoscalersSettings existing) : base(exi { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); UpdateSettings = existing.UpdateSettings; + UpdateOperationsSettings = existing.UpdateOperationsSettings.Clone(); OnCopy(existing); } @@ -67,6 +72,24 @@ private RegionAutoscalersSettings(RegionAutoscalersSettings existing) : base(exi /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionAutoscalersClient.Delete and + /// RegionAutoscalersClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to RegionAutoscalersClient.Get /// and RegionAutoscalersClient.GetAsync. @@ -91,6 +114,24 @@ private RegionAutoscalersSettings(RegionAutoscalersSettings existing) : base(exi /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionAutoscalersClient.Insert and + /// RegionAutoscalersClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionAutoscalersClient.List and RegionAutoscalersClient.ListAsync. @@ -115,6 +156,24 @@ private RegionAutoscalersSettings(RegionAutoscalersSettings existing) : base(exi /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionAutoscalersClient.Patch and + /// RegionAutoscalersClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionAutoscalersClient.Update and RegionAutoscalersClient.UpdateAsync. @@ -127,6 +186,24 @@ private RegionAutoscalersSettings(RegionAutoscalersSettings existing) : base(exi /// public gaxgrpc::CallSettings UpdateSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionAutoscalersClient.Update and + /// RegionAutoscalersClient.UpdateAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings UpdateOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public RegionAutoscalersSettings Clone() => new RegionAutoscalersSettings(this); @@ -296,7 +373,7 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -305,7 +382,7 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -314,9 +391,35 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionAutoscalerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteRegionAutoscalerRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified autoscaler. /// @@ -331,7 +434,7 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string autoscaler, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string autoscaler, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteRegionAutoscalerRequest { Autoscaler = gax::GaxPreconditions.CheckNotNullOrEmpty(autoscaler, nameof(autoscaler)), @@ -353,7 +456,7 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string autoscaler, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string autoscaler, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteRegionAutoscalerRequest { Autoscaler = gax::GaxPreconditions.CheckNotNullOrEmpty(autoscaler, nameof(autoscaler)), @@ -375,7 +478,7 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string autoscaler, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string autoscaler, st::CancellationToken cancellationToken) => DeleteAsync(project, region, autoscaler, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -472,7 +575,7 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -481,7 +584,7 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -490,9 +593,35 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionAutoscalerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertRegionAutoscalerRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates an autoscaler in the specified project using the data included in the request. /// @@ -507,7 +636,7 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertRegionAutoscalerRequest { AutoscalerResource = gax::GaxPreconditions.CheckNotNull(autoscalerResource, nameof(autoscalerResource)), @@ -529,7 +658,7 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertRegionAutoscalerRequest { AutoscalerResource = gax::GaxPreconditions.CheckNotNull(autoscalerResource, nameof(autoscalerResource)), @@ -551,7 +680,7 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, Autoscaler autoscalerResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, Autoscaler autoscalerResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, autoscalerResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -634,7 +763,7 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -643,7 +772,7 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -652,9 +781,35 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchRegionAutoscalerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchRegionAutoscalerRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// @@ -669,7 +824,7 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string region, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string region, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchRegionAutoscalerRequest { AutoscalerResource = gax::GaxPreconditions.CheckNotNull(autoscalerResource, nameof(autoscalerResource)), @@ -691,7 +846,7 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string region, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchRegionAutoscalerRequest { AutoscalerResource = gax::GaxPreconditions.CheckNotNull(autoscalerResource, nameof(autoscalerResource)), @@ -713,7 +868,7 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, Autoscaler autoscalerResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string region, Autoscaler autoscalerResource, st::CancellationToken cancellationToken) => PatchAsync(project, region, autoscalerResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -722,7 +877,7 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(UpdateRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(UpdateRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -731,7 +886,7 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(UpdateRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -740,9 +895,35 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateRegionAutoscalerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(UpdateRegionAutoscalerRequest request, st::CancellationToken cancellationToken) => UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Update. + public virtual lro::OperationsClient UpdateOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Update. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceUpdate(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Update + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceUpdateAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + /// /// Updates an autoscaler in the specified project using the data included in the request. /// @@ -757,7 +938,7 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(string project, string region, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(string project, string region, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => Update(new UpdateRegionAutoscalerRequest { AutoscalerResource = gax::GaxPreconditions.CheckNotNull(autoscalerResource, nameof(autoscalerResource)), @@ -779,7 +960,7 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string region, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(string project, string region, Autoscaler autoscalerResource, gaxgrpc::CallSettings callSettings = null) => UpdateAsync(new UpdateRegionAutoscalerRequest { AutoscalerResource = gax::GaxPreconditions.CheckNotNull(autoscalerResource, nameof(autoscalerResource)), @@ -801,7 +982,7 @@ internal static RegionAutoscalersClient Create(grpccore::CallInvoker callInvoker /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string region, Autoscaler autoscalerResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(string project, string region, Autoscaler autoscalerResource, st::CancellationToken cancellationToken) => UpdateAsync(project, region, autoscalerResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -833,6 +1014,10 @@ public RegionAutoscalersClientImpl(RegionAutoscalers.RegionAutoscalersClient grp GrpcClient = grpcClient; RegionAutoscalersSettings effectiveSettings = settings ?? RegionAutoscalersSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.PatchOperationsSettings); + UpdateOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.UpdateOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("region", request => request.Region).WithGoogleRequestParam("autoscaler", request => request.Autoscaler); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -885,16 +1070,22 @@ public RegionAutoscalersClientImpl(RegionAutoscalers.RegionAutoscalersClient grp partial void Modify_UpdateRegionAutoscalerRequest(ref UpdateRegionAutoscalerRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified autoscaler. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionAutoscalerRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -903,10 +1094,13 @@ public override Operation Delete(DeleteRegionAutoscalerRequest request, gaxgrpc: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionAutoscalerRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -933,16 +1127,22 @@ public override Autoscaler Get(GetRegionAutoscalerRequest request, gaxgrpc::Call return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates an autoscaler in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionAutoscalerRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -951,10 +1151,13 @@ public override Operation Insert(InsertRegionAutoscalerRequest request, gaxgrpc: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionAutoscalerRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -981,16 +1184,22 @@ public override Operation Insert(InsertRegionAutoscalerRequest request, gaxgrpc: return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchRegionAutoscalerRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -999,22 +1208,31 @@ public override Operation Patch(PatchRegionAutoscalerRequest request, gaxgrpc::C /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchRegionAutoscalerRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } + /// The long-running operations client for Update. + public override lro::OperationsClient UpdateOperationsClient { get; } + /// /// Updates an autoscaler in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Update(UpdateRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Update(UpdateRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateRegionAutoscalerRequest(ref request, ref callSettings); - return _callUpdate.Sync(request, callSettings); + Operation response = _callUpdate.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } /// @@ -1023,10 +1241,13 @@ public override Operation Update(UpdateRegionAutoscalerRequest request, gaxgrpc: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task UpdateAsync(UpdateRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> UpdateAsync(UpdateRegionAutoscalerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateRegionAutoscalerRequest(ref request, ref callSettings); - return _callUpdate.Async(request, callSettings); + Operation response = await _callUpdate.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } } @@ -1047,4 +1268,18 @@ public partial class RegionAutoscalerList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class RegionAutoscalers + { + public partial class RegionAutoscalersClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionBackendServicesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionBackendServicesClient.g.cs index 305ce840b75a..5f3d678f8896 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionBackendServicesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionBackendServicesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -46,12 +47,16 @@ private RegionBackendServicesSettings(RegionBackendServicesSettings existing) : { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; GetHealthSettings = existing.GetHealthSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); UpdateSettings = existing.UpdateSettings; + UpdateOperationsSettings = existing.UpdateOperationsSettings.Clone(); OnCopy(existing); } @@ -69,6 +74,24 @@ private RegionBackendServicesSettings(RegionBackendServicesSettings existing) : /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionBackendServicesClient.Delete and + /// RegionBackendServicesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionBackendServicesClient.Get and RegionBackendServicesClient.GetAsync. @@ -105,6 +128,24 @@ private RegionBackendServicesSettings(RegionBackendServicesSettings existing) : /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionBackendServicesClient.Insert and + /// RegionBackendServicesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionBackendServicesClient.List and RegionBackendServicesClient.ListAsync. @@ -129,6 +170,24 @@ private RegionBackendServicesSettings(RegionBackendServicesSettings existing) : /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionBackendServicesClient.Patch and + /// RegionBackendServicesClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionBackendServicesClient.Update and RegionBackendServicesClient.UpdateAsync. @@ -141,6 +200,24 @@ private RegionBackendServicesSettings(RegionBackendServicesSettings existing) : /// public gaxgrpc::CallSettings UpdateSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionBackendServicesClient.Update and + /// RegionBackendServicesClient.UpdateAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings UpdateOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public RegionBackendServicesSettings Clone() => new RegionBackendServicesSettings(this); @@ -313,7 +390,7 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -322,7 +399,7 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -331,9 +408,35 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionBackendServiceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteRegionBackendServiceRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified regional BackendService resource. /// @@ -348,7 +451,7 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string backendService, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string backendService, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteRegionBackendServiceRequest { BackendService = gax::GaxPreconditions.CheckNotNullOrEmpty(backendService, nameof(backendService)), @@ -370,7 +473,7 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string backendService, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string backendService, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteRegionBackendServiceRequest { BackendService = gax::GaxPreconditions.CheckNotNullOrEmpty(backendService, nameof(backendService)), @@ -392,7 +495,7 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string backendService, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string backendService, st::CancellationToken cancellationToken) => DeleteAsync(project, region, backendService, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -585,7 +688,7 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -594,7 +697,7 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -603,9 +706,35 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionBackendServiceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertRegionBackendServiceRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a regional BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview. /// @@ -620,7 +749,7 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertRegionBackendServiceRequest { BackendServiceResource = gax::GaxPreconditions.CheckNotNull(backendServiceResource, nameof(backendServiceResource)), @@ -642,7 +771,7 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertRegionBackendServiceRequest { BackendServiceResource = gax::GaxPreconditions.CheckNotNull(backendServiceResource, nameof(backendServiceResource)), @@ -664,7 +793,7 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, BackendService backendServiceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, BackendService backendServiceResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, backendServiceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -747,7 +876,7 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -756,7 +885,7 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -765,9 +894,35 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchRegionBackendServiceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchRegionBackendServiceRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Updates the specified regional BackendService resource with the data included in the request. For more information, see Understanding backend services This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// @@ -785,7 +940,7 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string region, string backendService, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string region, string backendService, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchRegionBackendServiceRequest { BackendService = gax::GaxPreconditions.CheckNotNullOrEmpty(backendService, nameof(backendService)), @@ -811,7 +966,7 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, string backendService, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string region, string backendService, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchRegionBackendServiceRequest { BackendService = gax::GaxPreconditions.CheckNotNullOrEmpty(backendService, nameof(backendService)), @@ -837,7 +992,7 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, string backendService, BackendService backendServiceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string region, string backendService, BackendService backendServiceResource, st::CancellationToken cancellationToken) => PatchAsync(project, region, backendService, backendServiceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -846,7 +1001,7 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(UpdateRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(UpdateRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -855,7 +1010,7 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(UpdateRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -864,9 +1019,35 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateRegionBackendServiceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(UpdateRegionBackendServiceRequest request, st::CancellationToken cancellationToken) => UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Update. + public virtual lro::OperationsClient UpdateOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Update. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceUpdate(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Update + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceUpdateAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + /// /// Updates the specified regional BackendService resource with the data included in the request. For more information, see Backend services overview. /// @@ -884,7 +1065,7 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(string project, string region, string backendService, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(string project, string region, string backendService, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => Update(new UpdateRegionBackendServiceRequest { BackendService = gax::GaxPreconditions.CheckNotNullOrEmpty(backendService, nameof(backendService)), @@ -910,7 +1091,7 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string region, string backendService, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(string project, string region, string backendService, BackendService backendServiceResource, gaxgrpc::CallSettings callSettings = null) => UpdateAsync(new UpdateRegionBackendServiceRequest { BackendService = gax::GaxPreconditions.CheckNotNullOrEmpty(backendService, nameof(backendService)), @@ -936,7 +1117,7 @@ internal static RegionBackendServicesClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string region, string backendService, BackendService backendServiceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(string project, string region, string backendService, BackendService backendServiceResource, st::CancellationToken cancellationToken) => UpdateAsync(project, region, backendService, backendServiceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -971,6 +1152,10 @@ public RegionBackendServicesClientImpl(RegionBackendServices.RegionBackendServic GrpcClient = grpcClient; RegionBackendServicesSettings effectiveSettings = settings ?? RegionBackendServicesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.PatchOperationsSettings); + UpdateOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.UpdateOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("region", request => request.Region).WithGoogleRequestParam("backend_service", request => request.BackendService); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -1030,16 +1215,22 @@ public RegionBackendServicesClientImpl(RegionBackendServices.RegionBackendServic partial void Modify_UpdateRegionBackendServiceRequest(ref UpdateRegionBackendServiceRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified regional BackendService resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionBackendServiceRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1048,10 +1239,13 @@ public override Operation Delete(DeleteRegionBackendServiceRequest request, gaxg /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionBackendServiceRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1102,16 +1296,22 @@ public override BackendServiceGroupHealth GetHealth(GetHealthRegionBackendServic return _callGetHealth.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a regional BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionBackendServiceRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1120,10 +1320,13 @@ public override Operation Insert(InsertRegionBackendServiceRequest request, gaxg /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionBackendServiceRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1150,16 +1353,22 @@ public override Operation Insert(InsertRegionBackendServiceRequest request, gaxg return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Updates the specified regional BackendService resource with the data included in the request. For more information, see Understanding backend services This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchRegionBackendServiceRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1168,22 +1377,31 @@ public override Operation Patch(PatchRegionBackendServiceRequest request, gaxgrp /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchRegionBackendServiceRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } + /// The long-running operations client for Update. + public override lro::OperationsClient UpdateOperationsClient { get; } + /// /// Updates the specified regional BackendService resource with the data included in the request. For more information, see Backend services overview. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Update(UpdateRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Update(UpdateRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateRegionBackendServiceRequest(ref request, ref callSettings); - return _callUpdate.Sync(request, callSettings); + Operation response = _callUpdate.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } /// @@ -1192,10 +1410,13 @@ public override Operation Update(UpdateRegionBackendServiceRequest request, gaxg /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task UpdateAsync(UpdateRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> UpdateAsync(UpdateRegionBackendServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateRegionBackendServiceRequest(ref request, ref callSettings); - return _callUpdate.Async(request, callSettings); + Operation response = await _callUpdate.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } } @@ -1208,4 +1429,18 @@ public int PageSize set => MaxResults = checked((uint)value); } } + + public static partial class RegionBackendServices + { + public partial class RegionBackendServicesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionCommitmentsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionCommitmentsClient.g.cs index ba91a4bbbeec..b9fad3756899 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionCommitmentsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionCommitmentsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -47,6 +48,7 @@ private RegionCommitmentsSettings(RegionCommitmentsSettings existing) : base(exi AggregatedListSettings = existing.AggregatedListSettings; GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; OnCopy(existing); } @@ -89,6 +91,24 @@ private RegionCommitmentsSettings(RegionCommitmentsSettings existing) : base(exi /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionCommitmentsClient.Insert and + /// RegionCommitmentsClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionCommitmentsClient.List and RegionCommitmentsClient.ListAsync. @@ -428,7 +448,7 @@ internal static RegionCommitmentsClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertRegionCommitmentRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertRegionCommitmentRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -437,7 +457,7 @@ internal static RegionCommitmentsClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionCommitmentRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertRegionCommitmentRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -446,9 +466,35 @@ internal static RegionCommitmentsClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionCommitmentRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertRegionCommitmentRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a commitment in the specified project using the data included in the request. /// @@ -463,7 +509,7 @@ internal static RegionCommitmentsClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, Commitment commitmentResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, Commitment commitmentResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertRegionCommitmentRequest { CommitmentResource = gax::GaxPreconditions.CheckNotNull(commitmentResource, nameof(commitmentResource)), @@ -485,7 +531,7 @@ internal static RegionCommitmentsClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, Commitment commitmentResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, Commitment commitmentResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertRegionCommitmentRequest { CommitmentResource = gax::GaxPreconditions.CheckNotNull(commitmentResource, nameof(commitmentResource)), @@ -507,7 +553,7 @@ internal static RegionCommitmentsClient Create(grpccore::CallInvoker callInvoker /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, Commitment commitmentResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, Commitment commitmentResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, commitmentResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -609,6 +655,7 @@ public RegionCommitmentsClientImpl(RegionCommitments.RegionCommitmentsClient grp GrpcClient = grpcClient; RegionCommitmentsSettings effectiveSettings = settings ?? RegionCommitmentsSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); _callAggregatedList = clientHelper.BuildApiCall(grpcClient.AggregatedListAsync, grpcClient.AggregatedList, effectiveSettings.AggregatedListSettings).WithGoogleRequestParam("project", request => request.Project); Modify_ApiCall(ref _callAggregatedList); Modify_AggregatedListApiCall(ref _callAggregatedList); @@ -697,16 +744,22 @@ public override Commitment Get(GetRegionCommitmentRequest request, gaxgrpc::Call return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a commitment in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertRegionCommitmentRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertRegionCommitmentRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionCommitmentRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -715,10 +768,13 @@ public override Operation Insert(InsertRegionCommitmentRequest request, gaxgrpc: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertRegionCommitmentRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertRegionCommitmentRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionCommitmentRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -781,4 +837,18 @@ public partial class CommitmentList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class RegionCommitments + { + public partial class RegionCommitmentsClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionDisksClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionDisksClient.g.cs index cb79712fbfea..f0c060bd5a11 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionDisksClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionDisksClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -44,16 +45,23 @@ private RegionDisksSettings(RegionDisksSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AddResourcePoliciesSettings = existing.AddResourcePoliciesSettings; + AddResourcePoliciesOperationsSettings = existing.AddResourcePoliciesOperationsSettings.Clone(); CreateSnapshotSettings = existing.CreateSnapshotSettings; + CreateSnapshotOperationsSettings = existing.CreateSnapshotOperationsSettings.Clone(); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; GetIamPolicySettings = existing.GetIamPolicySettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; RemoveResourcePoliciesSettings = existing.RemoveResourcePoliciesSettings; + RemoveResourcePoliciesOperationsSettings = existing.RemoveResourcePoliciesOperationsSettings.Clone(); ResizeSettings = existing.ResizeSettings; + ResizeOperationsSettings = existing.ResizeOperationsSettings.Clone(); SetIamPolicySettings = existing.SetIamPolicySettings; SetLabelsSettings = existing.SetLabelsSettings; + SetLabelsOperationsSettings = existing.SetLabelsOperationsSettings.Clone(); TestIamPermissionsSettings = existing.TestIamPermissionsSettings; OnCopy(existing); } @@ -72,6 +80,24 @@ private RegionDisksSettings(RegionDisksSettings existing) : base(existing) /// public gaxgrpc::CallSettings AddResourcePoliciesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionDisksClient.AddResourcePolicies and + /// RegionDisksClient.AddResourcePoliciesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings AddResourcePoliciesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionDisksClient.CreateSnapshot and RegionDisksClient.CreateSnapshotAsync. @@ -84,6 +110,24 @@ private RegionDisksSettings(RegionDisksSettings existing) : base(existing) /// public gaxgrpc::CallSettings CreateSnapshotSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionDisksClient.CreateSnapshot and + /// RegionDisksClient.CreateSnapshotAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings CreateSnapshotOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to RegionDisksClient.Delete /// and RegionDisksClient.DeleteAsync. @@ -96,6 +140,24 @@ private RegionDisksSettings(RegionDisksSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionDisksClient.Delete and + /// RegionDisksClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to RegionDisksClient.Get /// and RegionDisksClient.GetAsync. @@ -132,6 +194,24 @@ private RegionDisksSettings(RegionDisksSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionDisksClient.Insert and + /// RegionDisksClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to RegionDisksClient.List /// and RegionDisksClient.ListAsync. @@ -156,6 +236,24 @@ private RegionDisksSettings(RegionDisksSettings existing) : base(existing) /// public gaxgrpc::CallSettings RemoveResourcePoliciesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionDisksClient.RemoveResourcePolicies and + /// RegionDisksClient.RemoveResourcePoliciesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings RemoveResourcePoliciesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to RegionDisksClient.Resize /// and RegionDisksClient.ResizeAsync. @@ -168,6 +266,24 @@ private RegionDisksSettings(RegionDisksSettings existing) : base(existing) /// public gaxgrpc::CallSettings ResizeSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionDisksClient.Resize and + /// RegionDisksClient.ResizeAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings ResizeOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionDisksClient.SetIamPolicy and RegionDisksClient.SetIamPolicyAsync. @@ -192,6 +308,24 @@ private RegionDisksSettings(RegionDisksSettings existing) : base(existing) /// public gaxgrpc::CallSettings SetLabelsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionDisksClient.SetLabels and + /// RegionDisksClient.SetLabelsAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetLabelsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionDisksClient.TestIamPermissions and RegionDisksClient.TestIamPermissionsAsync. @@ -372,7 +506,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddResourcePolicies(AddResourcePoliciesRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddResourcePolicies(AddResourcePoliciesRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -381,7 +515,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddResourcePoliciesAsync(AddResourcePoliciesRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddResourcePoliciesAsync(AddResourcePoliciesRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -390,9 +524,36 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddResourcePoliciesAsync(AddResourcePoliciesRegionDiskRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddResourcePoliciesAsync(AddResourcePoliciesRegionDiskRequest request, st::CancellationToken cancellationToken) => AddResourcePoliciesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for AddResourcePolicies. + public virtual lro::OperationsClient AddResourcePoliciesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of AddResourcePolicies + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceAddResourcePolicies(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddResourcePoliciesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// AddResourcePolicies. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceAddResourcePoliciesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddResourcePoliciesOperationsClient, callSettings); + /// /// Adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation. /// @@ -410,7 +571,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddResourcePolicies(string project, string region, string disk, RegionDisksAddResourcePoliciesRequest regionDisksAddResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddResourcePolicies(string project, string region, string disk, RegionDisksAddResourcePoliciesRequest regionDisksAddResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => AddResourcePolicies(new AddResourcePoliciesRegionDiskRequest { Disk = gax::GaxPreconditions.CheckNotNullOrEmpty(disk, nameof(disk)), @@ -436,7 +597,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddResourcePoliciesAsync(string project, string region, string disk, RegionDisksAddResourcePoliciesRequest regionDisksAddResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddResourcePoliciesAsync(string project, string region, string disk, RegionDisksAddResourcePoliciesRequest regionDisksAddResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => AddResourcePoliciesAsync(new AddResourcePoliciesRegionDiskRequest { Disk = gax::GaxPreconditions.CheckNotNullOrEmpty(disk, nameof(disk)), @@ -462,7 +623,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddResourcePoliciesAsync(string project, string region, string disk, RegionDisksAddResourcePoliciesRequest regionDisksAddResourcePoliciesRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddResourcePoliciesAsync(string project, string region, string disk, RegionDisksAddResourcePoliciesRequest regionDisksAddResourcePoliciesRequestResource, st::CancellationToken cancellationToken) => AddResourcePoliciesAsync(project, region, disk, regionDisksAddResourcePoliciesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -471,7 +632,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation CreateSnapshot(CreateSnapshotRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation CreateSnapshot(CreateSnapshotRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -480,7 +641,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task CreateSnapshotAsync(CreateSnapshotRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> CreateSnapshotAsync(CreateSnapshotRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -489,9 +650,35 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task CreateSnapshotAsync(CreateSnapshotRegionDiskRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> CreateSnapshotAsync(CreateSnapshotRegionDiskRequest request, st::CancellationToken cancellationToken) => CreateSnapshotAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for CreateSnapshot. + public virtual lro::OperationsClient CreateSnapshotOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of CreateSnapshot. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceCreateSnapshot(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), CreateSnapshotOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// CreateSnapshot. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceCreateSnapshotAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), CreateSnapshotOperationsClient, callSettings); + /// /// Creates a snapshot of this regional disk. /// @@ -509,7 +696,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation CreateSnapshot(string project, string region, string disk, Snapshot snapshotResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation CreateSnapshot(string project, string region, string disk, Snapshot snapshotResource, gaxgrpc::CallSettings callSettings = null) => CreateSnapshot(new CreateSnapshotRegionDiskRequest { Disk = gax::GaxPreconditions.CheckNotNullOrEmpty(disk, nameof(disk)), @@ -535,7 +722,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task CreateSnapshotAsync(string project, string region, string disk, Snapshot snapshotResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> CreateSnapshotAsync(string project, string region, string disk, Snapshot snapshotResource, gaxgrpc::CallSettings callSettings = null) => CreateSnapshotAsync(new CreateSnapshotRegionDiskRequest { Disk = gax::GaxPreconditions.CheckNotNullOrEmpty(disk, nameof(disk)), @@ -561,7 +748,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task CreateSnapshotAsync(string project, string region, string disk, Snapshot snapshotResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> CreateSnapshotAsync(string project, string region, string disk, Snapshot snapshotResource, st::CancellationToken cancellationToken) => CreateSnapshotAsync(project, region, disk, snapshotResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -570,7 +757,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -579,7 +766,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -588,9 +775,35 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionDiskRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteRegionDiskRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. /// @@ -605,7 +818,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string disk, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string disk, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteRegionDiskRequest { Disk = gax::GaxPreconditions.CheckNotNullOrEmpty(disk, nameof(disk)), @@ -627,7 +840,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string disk, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string disk, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteRegionDiskRequest { Disk = gax::GaxPreconditions.CheckNotNullOrEmpty(disk, nameof(disk)), @@ -649,7 +862,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string disk, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string disk, st::CancellationToken cancellationToken) => DeleteAsync(project, region, disk, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -834,7 +1047,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -843,7 +1056,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -852,9 +1065,35 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionDiskRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertRegionDiskRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a persistent regional disk in the specified project using the data included in the request. /// @@ -869,7 +1108,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, Disk diskResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, Disk diskResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertRegionDiskRequest { DiskResource = gax::GaxPreconditions.CheckNotNull(diskResource, nameof(diskResource)), @@ -891,7 +1130,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, Disk diskResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, Disk diskResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertRegionDiskRequest { DiskResource = gax::GaxPreconditions.CheckNotNull(diskResource, nameof(diskResource)), @@ -913,7 +1152,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, Disk diskResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, Disk diskResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, diskResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -996,7 +1235,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RemoveResourcePolicies(RemoveResourcePoliciesRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RemoveResourcePolicies(RemoveResourcePoliciesRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1005,7 +1244,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RemoveResourcePoliciesAsync(RemoveResourcePoliciesRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RemoveResourcePoliciesAsync(RemoveResourcePoliciesRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1014,9 +1253,36 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RemoveResourcePoliciesAsync(RemoveResourcePoliciesRegionDiskRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> RemoveResourcePoliciesAsync(RemoveResourcePoliciesRegionDiskRequest request, st::CancellationToken cancellationToken) => RemoveResourcePoliciesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for RemoveResourcePolicies. + public virtual lro::OperationsClient RemoveResourcePoliciesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of + /// RemoveResourcePolicies. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceRemoveResourcePolicies(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RemoveResourcePoliciesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// RemoveResourcePolicies. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceRemoveResourcePoliciesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RemoveResourcePoliciesOperationsClient, callSettings); + /// /// Removes resource policies from a regional disk. /// @@ -1034,7 +1300,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RemoveResourcePolicies(string project, string region, string disk, RegionDisksRemoveResourcePoliciesRequest regionDisksRemoveResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RemoveResourcePolicies(string project, string region, string disk, RegionDisksRemoveResourcePoliciesRequest regionDisksRemoveResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => RemoveResourcePolicies(new RemoveResourcePoliciesRegionDiskRequest { Disk = gax::GaxPreconditions.CheckNotNullOrEmpty(disk, nameof(disk)), @@ -1060,7 +1326,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RemoveResourcePoliciesAsync(string project, string region, string disk, RegionDisksRemoveResourcePoliciesRequest regionDisksRemoveResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RemoveResourcePoliciesAsync(string project, string region, string disk, RegionDisksRemoveResourcePoliciesRequest regionDisksRemoveResourcePoliciesRequestResource, gaxgrpc::CallSettings callSettings = null) => RemoveResourcePoliciesAsync(new RemoveResourcePoliciesRegionDiskRequest { Disk = gax::GaxPreconditions.CheckNotNullOrEmpty(disk, nameof(disk)), @@ -1086,7 +1352,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RemoveResourcePoliciesAsync(string project, string region, string disk, RegionDisksRemoveResourcePoliciesRequest regionDisksRemoveResourcePoliciesRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> RemoveResourcePoliciesAsync(string project, string region, string disk, RegionDisksRemoveResourcePoliciesRequest regionDisksRemoveResourcePoliciesRequestResource, st::CancellationToken cancellationToken) => RemoveResourcePoliciesAsync(project, region, disk, regionDisksRemoveResourcePoliciesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1095,7 +1361,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Resize(ResizeRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Resize(ResizeRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1104,7 +1370,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task ResizeAsync(ResizeRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> ResizeAsync(ResizeRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1113,9 +1379,35 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task ResizeAsync(ResizeRegionDiskRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> ResizeAsync(ResizeRegionDiskRequest request, st::CancellationToken cancellationToken) => ResizeAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Resize. + public virtual lro::OperationsClient ResizeOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Resize. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceResize(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), ResizeOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Resize + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceResizeAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), ResizeOperationsClient, callSettings); + /// /// Resizes the specified regional persistent disk. /// @@ -1133,7 +1425,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Resize(string project, string region, string disk, RegionDisksResizeRequest regionDisksResizeRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Resize(string project, string region, string disk, RegionDisksResizeRequest regionDisksResizeRequestResource, gaxgrpc::CallSettings callSettings = null) => Resize(new ResizeRegionDiskRequest { Disk = gax::GaxPreconditions.CheckNotNullOrEmpty(disk, nameof(disk)), @@ -1159,7 +1451,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task ResizeAsync(string project, string region, string disk, RegionDisksResizeRequest regionDisksResizeRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> ResizeAsync(string project, string region, string disk, RegionDisksResizeRequest regionDisksResizeRequestResource, gaxgrpc::CallSettings callSettings = null) => ResizeAsync(new ResizeRegionDiskRequest { Disk = gax::GaxPreconditions.CheckNotNullOrEmpty(disk, nameof(disk)), @@ -1185,7 +1477,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task ResizeAsync(string project, string region, string disk, RegionDisksResizeRequest regionDisksResizeRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> ResizeAsync(string project, string region, string disk, RegionDisksResizeRequest regionDisksResizeRequestResource, st::CancellationToken cancellationToken) => ResizeAsync(project, region, disk, regionDisksResizeRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1293,7 +1585,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetLabels(SetLabelsRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetLabels(SetLabelsRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1302,7 +1594,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(SetLabelsRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetLabelsAsync(SetLabelsRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1311,9 +1603,35 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(SetLabelsRegionDiskRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetLabelsAsync(SetLabelsRegionDiskRequest request, st::CancellationToken cancellationToken) => SetLabelsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetLabels. + public virtual lro::OperationsClient SetLabelsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetLabels. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetLabels(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetLabelsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetLabels. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetLabelsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetLabelsOperationsClient, callSettings); + /// /// Sets the labels on the target regional disk. /// @@ -1331,7 +1649,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetLabels(string project, string region, string resource, RegionSetLabelsRequest regionSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetLabels(string project, string region, string resource, RegionSetLabelsRequest regionSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetLabels(new SetLabelsRegionDiskRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1357,7 +1675,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(string project, string region, string resource, RegionSetLabelsRequest regionSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetLabelsAsync(string project, string region, string resource, RegionSetLabelsRequest regionSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetLabelsAsync(new SetLabelsRegionDiskRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1383,7 +1701,7 @@ internal static RegionDisksClient Create(grpccore::CallInvoker callInvoker, Regi /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(string project, string region, string resource, RegionSetLabelsRequest regionSetLabelsRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetLabelsAsync(string project, string region, string resource, RegionSetLabelsRequest regionSetLabelsRequestResource, st::CancellationToken cancellationToken) => SetLabelsAsync(project, region, resource, regionSetLabelsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1526,6 +1844,13 @@ public RegionDisksClientImpl(RegionDisks.RegionDisksClient grpcClient, RegionDis GrpcClient = grpcClient; RegionDisksSettings effectiveSettings = settings ?? RegionDisksSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + AddResourcePoliciesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.AddResourcePoliciesOperationsSettings); + CreateSnapshotOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.CreateSnapshotOperationsSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); + RemoveResourcePoliciesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.RemoveResourcePoliciesOperationsSettings); + ResizeOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.ResizeOperationsSettings); + SetLabelsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.SetLabelsOperationsSettings); _callAddResourcePolicies = clientHelper.BuildApiCall(grpcClient.AddResourcePoliciesAsync, grpcClient.AddResourcePolicies, effectiveSettings.AddResourcePoliciesSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("region", request => request.Region).WithGoogleRequestParam("disk", request => request.Disk); Modify_ApiCall(ref _callAddResourcePolicies); Modify_AddResourcePoliciesApiCall(ref _callAddResourcePolicies); @@ -1620,16 +1945,22 @@ public RegionDisksClientImpl(RegionDisks.RegionDisksClient grpcClient, RegionDis partial void Modify_TestIamPermissionsRegionDiskRequest(ref TestIamPermissionsRegionDiskRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for AddResourcePolicies. + public override lro::OperationsClient AddResourcePoliciesOperationsClient { get; } + /// /// Adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation AddResourcePolicies(AddResourcePoliciesRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation AddResourcePolicies(AddResourcePoliciesRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddResourcePoliciesRegionDiskRequest(ref request, ref callSettings); - return _callAddResourcePolicies.Sync(request, callSettings); + Operation response = _callAddResourcePolicies.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddResourcePoliciesOperationsClient); } /// @@ -1638,22 +1969,31 @@ public override Operation AddResourcePolicies(AddResourcePoliciesRegionDiskReque /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task AddResourcePoliciesAsync(AddResourcePoliciesRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> AddResourcePoliciesAsync(AddResourcePoliciesRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddResourcePoliciesRegionDiskRequest(ref request, ref callSettings); - return _callAddResourcePolicies.Async(request, callSettings); + Operation response = await _callAddResourcePolicies.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddResourcePoliciesOperationsClient); } + /// The long-running operations client for CreateSnapshot. + public override lro::OperationsClient CreateSnapshotOperationsClient { get; } + /// /// Creates a snapshot of this regional disk. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation CreateSnapshot(CreateSnapshotRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation CreateSnapshot(CreateSnapshotRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_CreateSnapshotRegionDiskRequest(ref request, ref callSettings); - return _callCreateSnapshot.Sync(request, callSettings); + Operation response = _callCreateSnapshot.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), CreateSnapshotOperationsClient); } /// @@ -1662,22 +2002,31 @@ public override Operation CreateSnapshot(CreateSnapshotRegionDiskRequest request /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task CreateSnapshotAsync(CreateSnapshotRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> CreateSnapshotAsync(CreateSnapshotRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_CreateSnapshotRegionDiskRequest(ref request, ref callSettings); - return _callCreateSnapshot.Async(request, callSettings); + Operation response = await _callCreateSnapshot.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), CreateSnapshotOperationsClient); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionDiskRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1686,10 +2035,13 @@ public override Operation Delete(DeleteRegionDiskRequest request, gaxgrpc::CallS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionDiskRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1740,16 +2092,22 @@ public override Policy GetIamPolicy(GetIamPolicyRegionDiskRequest request, gaxgr return _callGetIamPolicy.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a persistent regional disk in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionDiskRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1758,10 +2116,13 @@ public override Operation Insert(InsertRegionDiskRequest request, gaxgrpc::CallS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionDiskRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1788,16 +2149,22 @@ public override Operation Insert(InsertRegionDiskRequest request, gaxgrpc::CallS return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for RemoveResourcePolicies. + public override lro::OperationsClient RemoveResourcePoliciesOperationsClient { get; } + /// /// Removes resource policies from a regional disk. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation RemoveResourcePolicies(RemoveResourcePoliciesRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation RemoveResourcePolicies(RemoveResourcePoliciesRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RemoveResourcePoliciesRegionDiskRequest(ref request, ref callSettings); - return _callRemoveResourcePolicies.Sync(request, callSettings); + Operation response = _callRemoveResourcePolicies.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RemoveResourcePoliciesOperationsClient); } /// @@ -1806,22 +2173,31 @@ public override Operation RemoveResourcePolicies(RemoveResourcePoliciesRegionDis /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task RemoveResourcePoliciesAsync(RemoveResourcePoliciesRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> RemoveResourcePoliciesAsync(RemoveResourcePoliciesRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RemoveResourcePoliciesRegionDiskRequest(ref request, ref callSettings); - return _callRemoveResourcePolicies.Async(request, callSettings); + Operation response = await _callRemoveResourcePolicies.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RemoveResourcePoliciesOperationsClient); } + /// The long-running operations client for Resize. + public override lro::OperationsClient ResizeOperationsClient { get; } + /// /// Resizes the specified regional persistent disk. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Resize(ResizeRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Resize(ResizeRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ResizeRegionDiskRequest(ref request, ref callSettings); - return _callResize.Sync(request, callSettings); + Operation response = _callResize.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), ResizeOperationsClient); } /// @@ -1830,10 +2206,13 @@ public override Operation Resize(ResizeRegionDiskRequest request, gaxgrpc::CallS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task ResizeAsync(ResizeRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> ResizeAsync(ResizeRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ResizeRegionDiskRequest(ref request, ref callSettings); - return _callResize.Async(request, callSettings); + Operation response = await _callResize.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), ResizeOperationsClient); } /// @@ -1860,16 +2239,22 @@ public override Policy SetIamPolicy(SetIamPolicyRegionDiskRequest request, gaxgr return _callSetIamPolicy.Async(request, callSettings); } + /// The long-running operations client for SetLabels. + public override lro::OperationsClient SetLabelsOperationsClient { get; } + /// /// Sets the labels on the target regional disk. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetLabels(SetLabelsRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetLabels(SetLabelsRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetLabelsRegionDiskRequest(ref request, ref callSettings); - return _callSetLabels.Sync(request, callSettings); + Operation response = _callSetLabels.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetLabelsOperationsClient); } /// @@ -1878,10 +2263,13 @@ public override Operation SetLabels(SetLabelsRegionDiskRequest request, gaxgrpc: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetLabelsAsync(SetLabelsRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetLabelsAsync(SetLabelsRegionDiskRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetLabelsRegionDiskRequest(ref request, ref callSettings); - return _callSetLabels.Async(request, callSettings); + Operation response = await _callSetLabels.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetLabelsOperationsClient); } /// @@ -1918,4 +2306,18 @@ public int PageSize set => MaxResults = checked((uint)value); } } + + public static partial class RegionDisks + { + public partial class RegionDisksClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionHealthCheckServicesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionHealthCheckServicesClient.g.cs index 5afc0a46a749..8e8d773bb9fb 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionHealthCheckServicesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionHealthCheckServicesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -47,10 +48,13 @@ private RegionHealthCheckServicesSettings(RegionHealthCheckServicesSettings exis { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); OnCopy(existing); } @@ -68,6 +72,24 @@ private RegionHealthCheckServicesSettings(RegionHealthCheckServicesSettings exis /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionHealthCheckServicesClient.Delete and + /// RegionHealthCheckServicesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionHealthCheckServicesClient.Get and RegionHealthCheckServicesClient.GetAsync. @@ -92,6 +114,24 @@ private RegionHealthCheckServicesSettings(RegionHealthCheckServicesSettings exis /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionHealthCheckServicesClient.Insert and + /// RegionHealthCheckServicesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionHealthCheckServicesClient.List and RegionHealthCheckServicesClient.ListAsync. @@ -116,6 +156,24 @@ private RegionHealthCheckServicesSettings(RegionHealthCheckServicesSettings exis /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionHealthCheckServicesClient.Patch and + /// RegionHealthCheckServicesClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public RegionHealthCheckServicesSettings Clone() => new RegionHealthCheckServicesSettings(this); @@ -288,7 +346,7 @@ internal static RegionHealthCheckServicesClient Create(grpccore::CallInvoker cal /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -297,7 +355,7 @@ internal static RegionHealthCheckServicesClient Create(grpccore::CallInvoker cal /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -306,9 +364,35 @@ internal static RegionHealthCheckServicesClient Create(grpccore::CallInvoker cal /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionHealthCheckServiceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteRegionHealthCheckServiceRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified regional HealthCheckService. /// @@ -323,7 +407,7 @@ internal static RegionHealthCheckServicesClient Create(grpccore::CallInvoker cal /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string healthCheckService, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string healthCheckService, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteRegionHealthCheckServiceRequest { HealthCheckService = gax::GaxPreconditions.CheckNotNullOrEmpty(healthCheckService, nameof(healthCheckService)), @@ -345,7 +429,7 @@ internal static RegionHealthCheckServicesClient Create(grpccore::CallInvoker cal /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string healthCheckService, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string healthCheckService, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteRegionHealthCheckServiceRequest { HealthCheckService = gax::GaxPreconditions.CheckNotNullOrEmpty(healthCheckService, nameof(healthCheckService)), @@ -367,7 +451,7 @@ internal static RegionHealthCheckServicesClient Create(grpccore::CallInvoker cal /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string healthCheckService, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string healthCheckService, st::CancellationToken cancellationToken) => DeleteAsync(project, region, healthCheckService, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -464,7 +548,7 @@ internal static RegionHealthCheckServicesClient Create(grpccore::CallInvoker cal /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -473,7 +557,7 @@ internal static RegionHealthCheckServicesClient Create(grpccore::CallInvoker cal /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -482,9 +566,35 @@ internal static RegionHealthCheckServicesClient Create(grpccore::CallInvoker cal /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionHealthCheckServiceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertRegionHealthCheckServiceRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a regional HealthCheckService resource in the specified project and region using the data included in the request. /// @@ -499,7 +609,7 @@ internal static RegionHealthCheckServicesClient Create(grpccore::CallInvoker cal /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, HealthCheckService healthCheckServiceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, HealthCheckService healthCheckServiceResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertRegionHealthCheckServiceRequest { HealthCheckServiceResource = gax::GaxPreconditions.CheckNotNull(healthCheckServiceResource, nameof(healthCheckServiceResource)), @@ -521,7 +631,7 @@ internal static RegionHealthCheckServicesClient Create(grpccore::CallInvoker cal /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, HealthCheckService healthCheckServiceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, HealthCheckService healthCheckServiceResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertRegionHealthCheckServiceRequest { HealthCheckServiceResource = gax::GaxPreconditions.CheckNotNull(healthCheckServiceResource, nameof(healthCheckServiceResource)), @@ -543,7 +653,7 @@ internal static RegionHealthCheckServicesClient Create(grpccore::CallInvoker cal /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, HealthCheckService healthCheckServiceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, HealthCheckService healthCheckServiceResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, healthCheckServiceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -626,7 +736,7 @@ internal static RegionHealthCheckServicesClient Create(grpccore::CallInvoker cal /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -635,7 +745,7 @@ internal static RegionHealthCheckServicesClient Create(grpccore::CallInvoker cal /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -644,9 +754,35 @@ internal static RegionHealthCheckServicesClient Create(grpccore::CallInvoker cal /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchRegionHealthCheckServiceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchRegionHealthCheckServiceRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Updates the specified regional HealthCheckService resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// @@ -664,7 +800,7 @@ internal static RegionHealthCheckServicesClient Create(grpccore::CallInvoker cal /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string region, string healthCheckService, HealthCheckService healthCheckServiceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string region, string healthCheckService, HealthCheckService healthCheckServiceResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchRegionHealthCheckServiceRequest { HealthCheckService = gax::GaxPreconditions.CheckNotNullOrEmpty(healthCheckService, nameof(healthCheckService)), @@ -690,7 +826,7 @@ internal static RegionHealthCheckServicesClient Create(grpccore::CallInvoker cal /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, string healthCheckService, HealthCheckService healthCheckServiceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string region, string healthCheckService, HealthCheckService healthCheckServiceResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchRegionHealthCheckServiceRequest { HealthCheckService = gax::GaxPreconditions.CheckNotNullOrEmpty(healthCheckService, nameof(healthCheckService)), @@ -716,7 +852,7 @@ internal static RegionHealthCheckServicesClient Create(grpccore::CallInvoker cal /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, string healthCheckService, HealthCheckService healthCheckServiceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string region, string healthCheckService, HealthCheckService healthCheckServiceResource, st::CancellationToken cancellationToken) => PatchAsync(project, region, healthCheckService, healthCheckServiceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -749,6 +885,9 @@ public RegionHealthCheckServicesClientImpl(RegionHealthCheckServices.RegionHealt GrpcClient = grpcClient; RegionHealthCheckServicesSettings effectiveSettings = settings ?? RegionHealthCheckServicesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.PatchOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("region", request => request.Region).WithGoogleRequestParam("health_check_service", request => request.HealthCheckService); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -794,16 +933,22 @@ public RegionHealthCheckServicesClientImpl(RegionHealthCheckServices.RegionHealt partial void Modify_PatchRegionHealthCheckServiceRequest(ref PatchRegionHealthCheckServiceRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified regional HealthCheckService. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionHealthCheckServiceRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -812,10 +957,13 @@ public override Operation Delete(DeleteRegionHealthCheckServiceRequest request, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionHealthCheckServiceRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -842,16 +990,22 @@ public override HealthCheckService Get(GetRegionHealthCheckServiceRequest reques return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a regional HealthCheckService resource in the specified project and region using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionHealthCheckServiceRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -860,10 +1014,13 @@ public override Operation Insert(InsertRegionHealthCheckServiceRequest request, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionHealthCheckServiceRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -890,16 +1047,22 @@ public override Operation Insert(InsertRegionHealthCheckServiceRequest request, return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Updates the specified regional HealthCheckService resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchRegionHealthCheckServiceRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -908,10 +1071,13 @@ public override Operation Patch(PatchRegionHealthCheckServiceRequest request, ga /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchRegionHealthCheckServiceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchRegionHealthCheckServiceRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } } @@ -932,4 +1098,18 @@ public partial class HealthCheckServicesList : gaxgrpc::IPageResponse GetEnumerator(); } + + public static partial class RegionHealthCheckServices + { + public partial class RegionHealthCheckServicesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionHealthChecksClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionHealthChecksClient.g.cs index 2419edf8bb29..a8f3d2875b4e 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionHealthChecksClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionHealthChecksClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -44,11 +45,15 @@ private RegionHealthChecksSettings(RegionHealthChecksSettings existing) : base(e { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); UpdateSettings = existing.UpdateSettings; + UpdateOperationsSettings = existing.UpdateOperationsSettings.Clone(); OnCopy(existing); } @@ -66,6 +71,24 @@ private RegionHealthChecksSettings(RegionHealthChecksSettings existing) : base(e /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionHealthChecksClient.Delete and + /// RegionHealthChecksClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionHealthChecksClient.Get and RegionHealthChecksClient.GetAsync. @@ -90,6 +113,24 @@ private RegionHealthChecksSettings(RegionHealthChecksSettings existing) : base(e /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionHealthChecksClient.Insert and + /// RegionHealthChecksClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionHealthChecksClient.List and RegionHealthChecksClient.ListAsync. @@ -114,6 +155,24 @@ private RegionHealthChecksSettings(RegionHealthChecksSettings existing) : base(e /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionHealthChecksClient.Patch and + /// RegionHealthChecksClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionHealthChecksClient.Update and RegionHealthChecksClient.UpdateAsync. @@ -126,6 +185,24 @@ private RegionHealthChecksSettings(RegionHealthChecksSettings existing) : base(e /// public gaxgrpc::CallSettings UpdateSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionHealthChecksClient.Update and + /// RegionHealthChecksClient.UpdateAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings UpdateOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public RegionHealthChecksSettings Clone() => new RegionHealthChecksSettings(this); @@ -298,7 +375,7 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -307,7 +384,7 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -316,9 +393,35 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionHealthCheckRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteRegionHealthCheckRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified HealthCheck resource. /// @@ -333,7 +436,7 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string healthCheck, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string healthCheck, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteRegionHealthCheckRequest { HealthCheck = gax::GaxPreconditions.CheckNotNullOrEmpty(healthCheck, nameof(healthCheck)), @@ -355,7 +458,7 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string healthCheck, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string healthCheck, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteRegionHealthCheckRequest { HealthCheck = gax::GaxPreconditions.CheckNotNullOrEmpty(healthCheck, nameof(healthCheck)), @@ -377,7 +480,7 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string healthCheck, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string healthCheck, st::CancellationToken cancellationToken) => DeleteAsync(project, region, healthCheck, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -474,7 +577,7 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -483,7 +586,7 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -492,9 +595,35 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionHealthCheckRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertRegionHealthCheckRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a HealthCheck resource in the specified project using the data included in the request. /// @@ -509,7 +638,7 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertRegionHealthCheckRequest { HealthCheckResource = gax::GaxPreconditions.CheckNotNull(healthCheckResource, nameof(healthCheckResource)), @@ -531,7 +660,7 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertRegionHealthCheckRequest { HealthCheckResource = gax::GaxPreconditions.CheckNotNull(healthCheckResource, nameof(healthCheckResource)), @@ -553,7 +682,7 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, HealthCheck healthCheckResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, HealthCheck healthCheckResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, healthCheckResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -636,7 +765,7 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -645,7 +774,7 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -654,9 +783,35 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchRegionHealthCheckRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchRegionHealthCheckRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// @@ -674,7 +829,7 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string region, string healthCheck, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string region, string healthCheck, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchRegionHealthCheckRequest { HealthCheck = gax::GaxPreconditions.CheckNotNullOrEmpty(healthCheck, nameof(healthCheck)), @@ -700,7 +855,7 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, string healthCheck, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string region, string healthCheck, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchRegionHealthCheckRequest { HealthCheck = gax::GaxPreconditions.CheckNotNullOrEmpty(healthCheck, nameof(healthCheck)), @@ -726,7 +881,7 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, string healthCheck, HealthCheck healthCheckResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string region, string healthCheck, HealthCheck healthCheckResource, st::CancellationToken cancellationToken) => PatchAsync(project, region, healthCheck, healthCheckResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -735,7 +890,7 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(UpdateRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(UpdateRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -744,7 +899,7 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(UpdateRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -753,9 +908,35 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateRegionHealthCheckRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(UpdateRegionHealthCheckRequest request, st::CancellationToken cancellationToken) => UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Update. + public virtual lro::OperationsClient UpdateOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Update. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceUpdate(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Update + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceUpdateAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + /// /// Updates a HealthCheck resource in the specified project using the data included in the request. /// @@ -773,7 +954,7 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(string project, string region, string healthCheck, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(string project, string region, string healthCheck, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => Update(new UpdateRegionHealthCheckRequest { HealthCheck = gax::GaxPreconditions.CheckNotNullOrEmpty(healthCheck, nameof(healthCheck)), @@ -799,7 +980,7 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string region, string healthCheck, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(string project, string region, string healthCheck, HealthCheck healthCheckResource, gaxgrpc::CallSettings callSettings = null) => UpdateAsync(new UpdateRegionHealthCheckRequest { HealthCheck = gax::GaxPreconditions.CheckNotNullOrEmpty(healthCheck, nameof(healthCheck)), @@ -825,7 +1006,7 @@ internal static RegionHealthChecksClient Create(grpccore::CallInvoker callInvoke /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string region, string healthCheck, HealthCheck healthCheckResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(string project, string region, string healthCheck, HealthCheck healthCheckResource, st::CancellationToken cancellationToken) => UpdateAsync(project, region, healthCheck, healthCheckResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -857,6 +1038,10 @@ public RegionHealthChecksClientImpl(RegionHealthChecks.RegionHealthChecksClient GrpcClient = grpcClient; RegionHealthChecksSettings effectiveSettings = settings ?? RegionHealthChecksSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.PatchOperationsSettings); + UpdateOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.UpdateOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("region", request => request.Region).WithGoogleRequestParam("health_check", request => request.HealthCheck); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -909,16 +1094,22 @@ public RegionHealthChecksClientImpl(RegionHealthChecks.RegionHealthChecksClient partial void Modify_UpdateRegionHealthCheckRequest(ref UpdateRegionHealthCheckRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified HealthCheck resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionHealthCheckRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -927,10 +1118,13 @@ public override Operation Delete(DeleteRegionHealthCheckRequest request, gaxgrpc /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionHealthCheckRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -957,16 +1151,22 @@ public override HealthCheck Get(GetRegionHealthCheckRequest request, gaxgrpc::Ca return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a HealthCheck resource in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionHealthCheckRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -975,10 +1175,13 @@ public override Operation Insert(InsertRegionHealthCheckRequest request, gaxgrpc /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionHealthCheckRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1005,16 +1208,22 @@ public override Operation Insert(InsertRegionHealthCheckRequest request, gaxgrpc return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchRegionHealthCheckRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1023,22 +1232,31 @@ public override Operation Patch(PatchRegionHealthCheckRequest request, gaxgrpc:: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchRegionHealthCheckRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } + /// The long-running operations client for Update. + public override lro::OperationsClient UpdateOperationsClient { get; } + /// /// Updates a HealthCheck resource in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Update(UpdateRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Update(UpdateRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateRegionHealthCheckRequest(ref request, ref callSettings); - return _callUpdate.Sync(request, callSettings); + Operation response = _callUpdate.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } /// @@ -1047,10 +1265,13 @@ public override Operation Update(UpdateRegionHealthCheckRequest request, gaxgrpc /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task UpdateAsync(UpdateRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> UpdateAsync(UpdateRegionHealthCheckRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateRegionHealthCheckRequest(ref request, ref callSettings); - return _callUpdate.Async(request, callSettings); + Operation response = await _callUpdate.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } } @@ -1063,4 +1284,18 @@ public int PageSize set => MaxResults = checked((uint)value); } } + + public static partial class RegionHealthChecks + { + public partial class RegionHealthChecksClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionInstanceGroupManagersClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionInstanceGroupManagersClient.g.cs index a68381cb5c37..0ffba2badf75 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionInstanceGroupManagersClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionInstanceGroupManagersClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -47,24 +48,38 @@ private RegionInstanceGroupManagersSettings(RegionInstanceGroupManagersSettings { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AbandonInstancesSettings = existing.AbandonInstancesSettings; + AbandonInstancesOperationsSettings = existing.AbandonInstancesOperationsSettings.Clone(); ApplyUpdatesToInstancesSettings = existing.ApplyUpdatesToInstancesSettings; + ApplyUpdatesToInstancesOperationsSettings = existing.ApplyUpdatesToInstancesOperationsSettings.Clone(); CreateInstancesSettings = existing.CreateInstancesSettings; + CreateInstancesOperationsSettings = existing.CreateInstancesOperationsSettings.Clone(); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); DeleteInstancesSettings = existing.DeleteInstancesSettings; + DeleteInstancesOperationsSettings = existing.DeleteInstancesOperationsSettings.Clone(); DeletePerInstanceConfigsSettings = existing.DeletePerInstanceConfigsSettings; + DeletePerInstanceConfigsOperationsSettings = existing.DeletePerInstanceConfigsOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; ListErrorsSettings = existing.ListErrorsSettings; ListManagedInstancesSettings = existing.ListManagedInstancesSettings; ListPerInstanceConfigsSettings = existing.ListPerInstanceConfigsSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); PatchPerInstanceConfigsSettings = existing.PatchPerInstanceConfigsSettings; + PatchPerInstanceConfigsOperationsSettings = existing.PatchPerInstanceConfigsOperationsSettings.Clone(); RecreateInstancesSettings = existing.RecreateInstancesSettings; + RecreateInstancesOperationsSettings = existing.RecreateInstancesOperationsSettings.Clone(); ResizeSettings = existing.ResizeSettings; + ResizeOperationsSettings = existing.ResizeOperationsSettings.Clone(); SetInstanceTemplateSettings = existing.SetInstanceTemplateSettings; + SetInstanceTemplateOperationsSettings = existing.SetInstanceTemplateOperationsSettings.Clone(); SetTargetPoolsSettings = existing.SetTargetPoolsSettings; + SetTargetPoolsOperationsSettings = existing.SetTargetPoolsOperationsSettings.Clone(); UpdatePerInstanceConfigsSettings = existing.UpdatePerInstanceConfigsSettings; + UpdatePerInstanceConfigsOperationsSettings = existing.UpdatePerInstanceConfigsOperationsSettings.Clone(); OnCopy(existing); } @@ -83,6 +98,24 @@ private RegionInstanceGroupManagersSettings(RegionInstanceGroupManagersSettings /// public gaxgrpc::CallSettings AbandonInstancesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionInstanceGroupManagersClient.AbandonInstances and + /// RegionInstanceGroupManagersClient.AbandonInstancesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings AbandonInstancesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionInstanceGroupManagersClient.ApplyUpdatesToInstances and @@ -96,6 +129,24 @@ private RegionInstanceGroupManagersSettings(RegionInstanceGroupManagersSettings /// public gaxgrpc::CallSettings ApplyUpdatesToInstancesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionInstanceGroupManagersClient.ApplyUpdatesToInstances + /// and RegionInstanceGroupManagersClient.ApplyUpdatesToInstancesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings ApplyUpdatesToInstancesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionInstanceGroupManagersClient.CreateInstances and @@ -109,6 +160,24 @@ private RegionInstanceGroupManagersSettings(RegionInstanceGroupManagersSettings /// public gaxgrpc::CallSettings CreateInstancesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionInstanceGroupManagersClient.CreateInstances and + /// RegionInstanceGroupManagersClient.CreateInstancesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings CreateInstancesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionInstanceGroupManagersClient.Delete and RegionInstanceGroupManagersClient.DeleteAsync. @@ -121,6 +190,24 @@ private RegionInstanceGroupManagersSettings(RegionInstanceGroupManagersSettings /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionInstanceGroupManagersClient.Delete and + /// RegionInstanceGroupManagersClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionInstanceGroupManagersClient.DeleteInstances and @@ -134,6 +221,24 @@ private RegionInstanceGroupManagersSettings(RegionInstanceGroupManagersSettings /// public gaxgrpc::CallSettings DeleteInstancesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionInstanceGroupManagersClient.DeleteInstances and + /// RegionInstanceGroupManagersClient.DeleteInstancesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteInstancesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionInstanceGroupManagersClient.DeletePerInstanceConfigs and @@ -147,6 +252,24 @@ private RegionInstanceGroupManagersSettings(RegionInstanceGroupManagersSettings /// public gaxgrpc::CallSettings DeletePerInstanceConfigsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionInstanceGroupManagersClient.DeletePerInstanceConfigs + /// and RegionInstanceGroupManagersClient.DeletePerInstanceConfigsAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeletePerInstanceConfigsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionInstanceGroupManagersClient.Get and RegionInstanceGroupManagersClient.GetAsync. @@ -171,6 +294,24 @@ private RegionInstanceGroupManagersSettings(RegionInstanceGroupManagersSettings /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionInstanceGroupManagersClient.Insert and + /// RegionInstanceGroupManagersClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionInstanceGroupManagersClient.List and RegionInstanceGroupManagersClient.ListAsync. @@ -234,6 +375,24 @@ private RegionInstanceGroupManagersSettings(RegionInstanceGroupManagersSettings /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionInstanceGroupManagersClient.Patch and + /// RegionInstanceGroupManagersClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionInstanceGroupManagersClient.PatchPerInstanceConfigs and @@ -247,6 +406,24 @@ private RegionInstanceGroupManagersSettings(RegionInstanceGroupManagersSettings /// public gaxgrpc::CallSettings PatchPerInstanceConfigsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionInstanceGroupManagersClient.PatchPerInstanceConfigs + /// and RegionInstanceGroupManagersClient.PatchPerInstanceConfigsAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchPerInstanceConfigsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionInstanceGroupManagersClient.RecreateInstances and @@ -260,6 +437,24 @@ private RegionInstanceGroupManagersSettings(RegionInstanceGroupManagersSettings /// public gaxgrpc::CallSettings RecreateInstancesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionInstanceGroupManagersClient.RecreateInstances and + /// RegionInstanceGroupManagersClient.RecreateInstancesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings RecreateInstancesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionInstanceGroupManagersClient.Resize and RegionInstanceGroupManagersClient.ResizeAsync. @@ -272,6 +467,24 @@ private RegionInstanceGroupManagersSettings(RegionInstanceGroupManagersSettings /// public gaxgrpc::CallSettings ResizeSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionInstanceGroupManagersClient.Resize and + /// RegionInstanceGroupManagersClient.ResizeAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings ResizeOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionInstanceGroupManagersClient.SetInstanceTemplate and @@ -285,6 +498,24 @@ private RegionInstanceGroupManagersSettings(RegionInstanceGroupManagersSettings /// public gaxgrpc::CallSettings SetInstanceTemplateSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionInstanceGroupManagersClient.SetInstanceTemplate + /// and RegionInstanceGroupManagersClient.SetInstanceTemplateAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetInstanceTemplateOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionInstanceGroupManagersClient.SetTargetPools and @@ -298,6 +529,24 @@ private RegionInstanceGroupManagersSettings(RegionInstanceGroupManagersSettings /// public gaxgrpc::CallSettings SetTargetPoolsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionInstanceGroupManagersClient.SetTargetPools and + /// RegionInstanceGroupManagersClient.SetTargetPoolsAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetTargetPoolsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionInstanceGroupManagersClient.UpdatePerInstanceConfigs and @@ -311,6 +560,24 @@ private RegionInstanceGroupManagersSettings(RegionInstanceGroupManagersSettings /// public gaxgrpc::CallSettings UpdatePerInstanceConfigsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionInstanceGroupManagersClient.UpdatePerInstanceConfigs + /// and RegionInstanceGroupManagersClient.UpdatePerInstanceConfigsAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings UpdatePerInstanceConfigsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public RegionInstanceGroupManagersSettings Clone() => new RegionInstanceGroupManagersSettings(this); @@ -487,7 +754,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AbandonInstances(AbandonInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AbandonInstances(AbandonInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -500,7 +767,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AbandonInstancesAsync(AbandonInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AbandonInstancesAsync(AbandonInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -513,9 +780,35 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AbandonInstancesAsync(AbandonInstancesRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> AbandonInstancesAsync(AbandonInstancesRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => AbandonInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for AbandonInstances. + public virtual lro::OperationsClient AbandonInstancesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of AbandonInstances. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceAbandonInstances(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AbandonInstancesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// AbandonInstances. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceAbandonInstancesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AbandonInstancesOperationsClient, callSettings); + /// /// Flags the specified instances to be immediately removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. /// @@ -537,7 +830,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AbandonInstances(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AbandonInstances(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => AbandonInstances(new AbandonInstancesRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -567,7 +860,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AbandonInstancesAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AbandonInstancesAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => AbandonInstancesAsync(new AbandonInstancesRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -597,7 +890,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AbandonInstancesAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> AbandonInstancesAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource, st::CancellationToken cancellationToken) => AbandonInstancesAsync(project, region, instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -606,7 +899,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation ApplyUpdatesToInstances(ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation ApplyUpdatesToInstances(ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -615,7 +908,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task ApplyUpdatesToInstancesAsync(ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> ApplyUpdatesToInstancesAsync(ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -624,9 +917,36 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task ApplyUpdatesToInstancesAsync(ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> ApplyUpdatesToInstancesAsync(ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => ApplyUpdatesToInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for ApplyUpdatesToInstances. + public virtual lro::OperationsClient ApplyUpdatesToInstancesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of + /// ApplyUpdatesToInstances. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceApplyUpdatesToInstances(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), ApplyUpdatesToInstancesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// ApplyUpdatesToInstances. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceApplyUpdatesToInstancesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), ApplyUpdatesToInstancesOperationsClient, callSettings); + /// /// Apply updates to selected instances the managed instance group. /// @@ -644,7 +964,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation ApplyUpdatesToInstances(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersApplyUpdatesRequest regionInstanceGroupManagersApplyUpdatesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation ApplyUpdatesToInstances(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersApplyUpdatesRequest regionInstanceGroupManagersApplyUpdatesRequestResource, gaxgrpc::CallSettings callSettings = null) => ApplyUpdatesToInstances(new ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -670,7 +990,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task ApplyUpdatesToInstancesAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersApplyUpdatesRequest regionInstanceGroupManagersApplyUpdatesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> ApplyUpdatesToInstancesAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersApplyUpdatesRequest regionInstanceGroupManagersApplyUpdatesRequestResource, gaxgrpc::CallSettings callSettings = null) => ApplyUpdatesToInstancesAsync(new ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -696,7 +1016,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task ApplyUpdatesToInstancesAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersApplyUpdatesRequest regionInstanceGroupManagersApplyUpdatesRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> ApplyUpdatesToInstancesAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersApplyUpdatesRequest regionInstanceGroupManagersApplyUpdatesRequestResource, st::CancellationToken cancellationToken) => ApplyUpdatesToInstancesAsync(project, region, instanceGroupManager, regionInstanceGroupManagersApplyUpdatesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -705,7 +1025,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation CreateInstances(CreateInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation CreateInstances(CreateInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -714,7 +1034,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task CreateInstancesAsync(CreateInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> CreateInstancesAsync(CreateInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -723,9 +1043,35 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task CreateInstancesAsync(CreateInstancesRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> CreateInstancesAsync(CreateInstancesRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => CreateInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for CreateInstances. + public virtual lro::OperationsClient CreateInstancesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of CreateInstances. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceCreateInstances(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), CreateInstancesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// CreateInstances. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceCreateInstancesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), CreateInstancesOperationsClient, callSettings); + /// /// Creates instances with per-instance configs in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. /// @@ -743,7 +1089,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation CreateInstances(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersCreateInstancesRequest regionInstanceGroupManagersCreateInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation CreateInstances(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersCreateInstancesRequest regionInstanceGroupManagersCreateInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => CreateInstances(new CreateInstancesRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -769,7 +1115,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task CreateInstancesAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersCreateInstancesRequest regionInstanceGroupManagersCreateInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> CreateInstancesAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersCreateInstancesRequest regionInstanceGroupManagersCreateInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => CreateInstancesAsync(new CreateInstancesRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -795,7 +1141,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task CreateInstancesAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersCreateInstancesRequest regionInstanceGroupManagersCreateInstancesRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> CreateInstancesAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersCreateInstancesRequest regionInstanceGroupManagersCreateInstancesRequestResource, st::CancellationToken cancellationToken) => CreateInstancesAsync(project, region, instanceGroupManager, regionInstanceGroupManagersCreateInstancesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -804,7 +1150,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -813,7 +1159,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -822,9 +1168,35 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified managed instance group and all of the instances in that group. /// @@ -839,7 +1211,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string instanceGroupManager, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string instanceGroupManager, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -861,7 +1233,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string instanceGroupManager, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string instanceGroupManager, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -883,7 +1255,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string instanceGroupManager, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string instanceGroupManager, st::CancellationToken cancellationToken) => DeleteAsync(project, region, instanceGroupManager, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -896,7 +1268,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DeleteInstances(DeleteInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DeleteInstances(DeleteInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -909,7 +1281,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteInstancesAsync(DeleteInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteInstancesAsync(DeleteInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -922,9 +1294,35 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteInstancesAsync(DeleteInstancesRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteInstancesAsync(DeleteInstancesRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => DeleteInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for DeleteInstances. + public virtual lro::OperationsClient DeleteInstancesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of DeleteInstances. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDeleteInstances(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteInstancesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// DeleteInstances. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteInstancesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteInstancesOperationsClient, callSettings); + /// /// Flags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method. /// @@ -946,7 +1344,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DeleteInstances(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DeleteInstances(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => DeleteInstances(new DeleteInstancesRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -976,7 +1374,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteInstancesAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteInstancesAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource, gaxgrpc::CallSettings callSettings = null) => DeleteInstancesAsync(new DeleteInstancesRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -1006,7 +1404,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteInstancesAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteInstancesAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource, st::CancellationToken cancellationToken) => DeleteInstancesAsync(project, region, instanceGroupManager, regionInstanceGroupManagersDeleteInstancesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1015,7 +1413,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DeletePerInstanceConfigs(DeletePerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DeletePerInstanceConfigs(DeletePerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1024,7 +1422,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeletePerInstanceConfigsAsync(DeletePerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeletePerInstanceConfigsAsync(DeletePerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1033,9 +1431,36 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeletePerInstanceConfigsAsync(DeletePerInstanceConfigsRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeletePerInstanceConfigsAsync(DeletePerInstanceConfigsRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => DeletePerInstanceConfigsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for DeletePerInstanceConfigs. + public virtual lro::OperationsClient DeletePerInstanceConfigsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of + /// DeletePerInstanceConfigs. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDeletePerInstanceConfigs(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeletePerInstanceConfigsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// DeletePerInstanceConfigs. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeletePerInstanceConfigsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeletePerInstanceConfigsOperationsClient, callSettings); + /// /// Deletes selected per-instance configs for the managed instance group. /// @@ -1053,7 +1478,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation DeletePerInstanceConfigs(string project, string region, string instanceGroupManager, RegionInstanceGroupManagerDeleteInstanceConfigReq regionInstanceGroupManagerDeleteInstanceConfigReqResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation DeletePerInstanceConfigs(string project, string region, string instanceGroupManager, RegionInstanceGroupManagerDeleteInstanceConfigReq regionInstanceGroupManagerDeleteInstanceConfigReqResource, gaxgrpc::CallSettings callSettings = null) => DeletePerInstanceConfigs(new DeletePerInstanceConfigsRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -1079,7 +1504,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeletePerInstanceConfigsAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagerDeleteInstanceConfigReq regionInstanceGroupManagerDeleteInstanceConfigReqResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeletePerInstanceConfigsAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagerDeleteInstanceConfigReq regionInstanceGroupManagerDeleteInstanceConfigReqResource, gaxgrpc::CallSettings callSettings = null) => DeletePerInstanceConfigsAsync(new DeletePerInstanceConfigsRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -1105,7 +1530,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeletePerInstanceConfigsAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagerDeleteInstanceConfigReq regionInstanceGroupManagerDeleteInstanceConfigReqResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeletePerInstanceConfigsAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagerDeleteInstanceConfigReq regionInstanceGroupManagerDeleteInstanceConfigReqResource, st::CancellationToken cancellationToken) => DeletePerInstanceConfigsAsync(project, region, instanceGroupManager, regionInstanceGroupManagerDeleteInstanceConfigReqResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1204,7 +1629,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1215,7 +1640,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1226,9 +1651,35 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. /// @@ -1245,7 +1696,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, InstanceGroupManager instanceGroupManagerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, InstanceGroupManager instanceGroupManagerResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertRegionInstanceGroupManagerRequest { InstanceGroupManagerResource = gax::GaxPreconditions.CheckNotNull(instanceGroupManagerResource, nameof(instanceGroupManagerResource)), @@ -1269,7 +1720,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, InstanceGroupManager instanceGroupManagerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, InstanceGroupManager instanceGroupManagerResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertRegionInstanceGroupManagerRequest { InstanceGroupManagerResource = gax::GaxPreconditions.CheckNotNull(instanceGroupManagerResource, nameof(instanceGroupManagerResource)), @@ -1293,7 +1744,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, InstanceGroupManager instanceGroupManagerResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, InstanceGroupManager instanceGroupManagerResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, instanceGroupManagerResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1622,7 +2073,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1631,7 +2082,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1640,9 +2091,35 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// @@ -1660,7 +2137,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string region, string instanceGroupManager, InstanceGroupManager instanceGroupManagerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string region, string instanceGroupManager, InstanceGroupManager instanceGroupManagerResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -1686,7 +2163,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, string instanceGroupManager, InstanceGroupManager instanceGroupManagerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string region, string instanceGroupManager, InstanceGroupManager instanceGroupManagerResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -1712,7 +2189,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, string instanceGroupManager, InstanceGroupManager instanceGroupManagerResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string region, string instanceGroupManager, InstanceGroupManager instanceGroupManagerResource, st::CancellationToken cancellationToken) => PatchAsync(project, region, instanceGroupManager, instanceGroupManagerResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1721,7 +2198,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation PatchPerInstanceConfigs(PatchPerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation PatchPerInstanceConfigs(PatchPerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1730,7 +2207,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchPerInstanceConfigsAsync(PatchPerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchPerInstanceConfigsAsync(PatchPerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1739,9 +2216,36 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchPerInstanceConfigsAsync(PatchPerInstanceConfigsRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchPerInstanceConfigsAsync(PatchPerInstanceConfigsRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => PatchPerInstanceConfigsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for PatchPerInstanceConfigs. + public virtual lro::OperationsClient PatchPerInstanceConfigsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of + /// PatchPerInstanceConfigs. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatchPerInstanceConfigs(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchPerInstanceConfigsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// PatchPerInstanceConfigs. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchPerInstanceConfigsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchPerInstanceConfigsOperationsClient, callSettings); + /// /// Inserts or patches per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. /// @@ -1759,7 +2263,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation PatchPerInstanceConfigs(string project, string region, string instanceGroupManager, RegionInstanceGroupManagerPatchInstanceConfigReq regionInstanceGroupManagerPatchInstanceConfigReqResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation PatchPerInstanceConfigs(string project, string region, string instanceGroupManager, RegionInstanceGroupManagerPatchInstanceConfigReq regionInstanceGroupManagerPatchInstanceConfigReqResource, gaxgrpc::CallSettings callSettings = null) => PatchPerInstanceConfigs(new PatchPerInstanceConfigsRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -1785,7 +2289,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchPerInstanceConfigsAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagerPatchInstanceConfigReq regionInstanceGroupManagerPatchInstanceConfigReqResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchPerInstanceConfigsAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagerPatchInstanceConfigReq regionInstanceGroupManagerPatchInstanceConfigReqResource, gaxgrpc::CallSettings callSettings = null) => PatchPerInstanceConfigsAsync(new PatchPerInstanceConfigsRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -1811,7 +2315,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchPerInstanceConfigsAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagerPatchInstanceConfigReq regionInstanceGroupManagerPatchInstanceConfigReqResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchPerInstanceConfigsAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagerPatchInstanceConfigReq regionInstanceGroupManagerPatchInstanceConfigReqResource, st::CancellationToken cancellationToken) => PatchPerInstanceConfigsAsync(project, region, instanceGroupManager, regionInstanceGroupManagerPatchInstanceConfigReqResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1824,7 +2328,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RecreateInstances(RecreateInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RecreateInstances(RecreateInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1837,7 +2341,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RecreateInstancesAsync(RecreateInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RecreateInstancesAsync(RecreateInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1850,9 +2354,36 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RecreateInstancesAsync(RecreateInstancesRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> RecreateInstancesAsync(RecreateInstancesRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => RecreateInstancesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for RecreateInstances. + public virtual lro::OperationsClient RecreateInstancesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of RecreateInstances + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceRecreateInstances(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RecreateInstancesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// RecreateInstances. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceRecreateInstancesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RecreateInstancesOperationsClient, callSettings); + /// /// Flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group's current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking its currentAction field; for more information, see Checking the status of managed instances. /// @@ -1874,7 +2405,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RecreateInstances(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RecreateInstances(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource, gaxgrpc::CallSettings callSettings = null) => RecreateInstances(new RecreateInstancesRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -1904,7 +2435,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RecreateInstancesAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RecreateInstancesAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource, gaxgrpc::CallSettings callSettings = null) => RecreateInstancesAsync(new RecreateInstancesRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -1934,7 +2465,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RecreateInstancesAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> RecreateInstancesAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource, st::CancellationToken cancellationToken) => RecreateInstancesAsync(project, region, instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1947,7 +2478,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Resize(ResizeRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Resize(ResizeRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1960,7 +2491,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task ResizeAsync(ResizeRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> ResizeAsync(ResizeRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1973,9 +2504,35 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task ResizeAsync(ResizeRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> ResizeAsync(ResizeRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => ResizeAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Resize. + public virtual lro::OperationsClient ResizeOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Resize. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceResize(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), ResizeOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Resize + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceResizeAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), ResizeOperationsClient, callSettings); + /// /// Changes the intended size of the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes one or more instances. /// @@ -1997,7 +2554,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Resize(string project, string region, string instanceGroupManager, int size, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Resize(string project, string region, string instanceGroupManager, int size, gaxgrpc::CallSettings callSettings = null) => Resize(new ResizeRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -2027,7 +2584,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task ResizeAsync(string project, string region, string instanceGroupManager, int size, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> ResizeAsync(string project, string region, string instanceGroupManager, int size, gaxgrpc::CallSettings callSettings = null) => ResizeAsync(new ResizeRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -2057,7 +2614,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task ResizeAsync(string project, string region, string instanceGroupManager, int size, st::CancellationToken cancellationToken) => + public virtual stt::Task> ResizeAsync(string project, string region, string instanceGroupManager, int size, st::CancellationToken cancellationToken) => ResizeAsync(project, region, instanceGroupManager, size, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -2066,7 +2623,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetInstanceTemplate(SetInstanceTemplateRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetInstanceTemplate(SetInstanceTemplateRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2075,7 +2632,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetInstanceTemplateAsync(SetInstanceTemplateRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetInstanceTemplateAsync(SetInstanceTemplateRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2084,9 +2641,36 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetInstanceTemplateAsync(SetInstanceTemplateRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetInstanceTemplateAsync(SetInstanceTemplateRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => SetInstanceTemplateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetInstanceTemplate. + public virtual lro::OperationsClient SetInstanceTemplateOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetInstanceTemplate + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetInstanceTemplate(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetInstanceTemplateOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetInstanceTemplate. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetInstanceTemplateAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetInstanceTemplateOperationsClient, callSettings); + /// /// Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. /// @@ -2104,7 +2688,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetInstanceTemplate(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetInstanceTemplate(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource, gaxgrpc::CallSettings callSettings = null) => SetInstanceTemplate(new SetInstanceTemplateRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -2130,7 +2714,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetInstanceTemplateAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetInstanceTemplateAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource, gaxgrpc::CallSettings callSettings = null) => SetInstanceTemplateAsync(new SetInstanceTemplateRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -2156,7 +2740,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetInstanceTemplateAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetInstanceTemplateAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource, st::CancellationToken cancellationToken) => SetInstanceTemplateAsync(project, region, instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -2165,7 +2749,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetTargetPools(SetTargetPoolsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetTargetPools(SetTargetPoolsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2174,7 +2758,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetTargetPoolsAsync(SetTargetPoolsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetTargetPoolsAsync(SetTargetPoolsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2183,9 +2767,35 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetTargetPoolsAsync(SetTargetPoolsRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetTargetPoolsAsync(SetTargetPoolsRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => SetTargetPoolsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetTargetPools. + public virtual lro::OperationsClient SetTargetPoolsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetTargetPools. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetTargetPools(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetTargetPoolsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetTargetPools. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetTargetPoolsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetTargetPoolsOperationsClient, callSettings); + /// /// Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. /// @@ -2203,7 +2813,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetTargetPools(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetTargetPools(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetTargetPools(new SetTargetPoolsRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -2229,7 +2839,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetTargetPoolsAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetTargetPoolsAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetTargetPoolsAsync(new SetTargetPoolsRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -2255,7 +2865,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetTargetPoolsAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetTargetPoolsAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource, st::CancellationToken cancellationToken) => SetTargetPoolsAsync(project, region, instanceGroupManager, regionInstanceGroupManagersSetTargetPoolsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -2264,7 +2874,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation UpdatePerInstanceConfigs(UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation UpdatePerInstanceConfigs(UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2273,7 +2883,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdatePerInstanceConfigsAsync(UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdatePerInstanceConfigsAsync(UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -2282,9 +2892,36 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdatePerInstanceConfigsAsync(UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdatePerInstanceConfigsAsync(UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest request, st::CancellationToken cancellationToken) => UpdatePerInstanceConfigsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for UpdatePerInstanceConfigs. + public virtual lro::OperationsClient UpdatePerInstanceConfigsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of + /// UpdatePerInstanceConfigs. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceUpdatePerInstanceConfigs(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdatePerInstanceConfigsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// UpdatePerInstanceConfigs. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceUpdatePerInstanceConfigsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdatePerInstanceConfigsOperationsClient, callSettings); + /// /// Inserts or updates per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. /// @@ -2302,7 +2939,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation UpdatePerInstanceConfigs(string project, string region, string instanceGroupManager, RegionInstanceGroupManagerUpdateInstanceConfigReq regionInstanceGroupManagerUpdateInstanceConfigReqResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation UpdatePerInstanceConfigs(string project, string region, string instanceGroupManager, RegionInstanceGroupManagerUpdateInstanceConfigReq regionInstanceGroupManagerUpdateInstanceConfigReqResource, gaxgrpc::CallSettings callSettings = null) => UpdatePerInstanceConfigs(new UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -2328,7 +2965,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdatePerInstanceConfigsAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagerUpdateInstanceConfigReq regionInstanceGroupManagerUpdateInstanceConfigReqResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdatePerInstanceConfigsAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagerUpdateInstanceConfigReq regionInstanceGroupManagerUpdateInstanceConfigReqResource, gaxgrpc::CallSettings callSettings = null) => UpdatePerInstanceConfigsAsync(new UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest { InstanceGroupManager = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroupManager, nameof(instanceGroupManager)), @@ -2354,7 +2991,7 @@ internal static RegionInstanceGroupManagersClient Create(grpccore::CallInvoker c /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdatePerInstanceConfigsAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagerUpdateInstanceConfigReq regionInstanceGroupManagerUpdateInstanceConfigReqResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdatePerInstanceConfigsAsync(string project, string region, string instanceGroupManager, RegionInstanceGroupManagerUpdateInstanceConfigReq regionInstanceGroupManagerUpdateInstanceConfigReqResource, st::CancellationToken cancellationToken) => UpdatePerInstanceConfigsAsync(project, region, instanceGroupManager, regionInstanceGroupManagerUpdateInstanceConfigReqResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -2415,6 +3052,20 @@ public RegionInstanceGroupManagersClientImpl(RegionInstanceGroupManagers.RegionI GrpcClient = grpcClient; RegionInstanceGroupManagersSettings effectiveSettings = settings ?? RegionInstanceGroupManagersSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + AbandonInstancesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.AbandonInstancesOperationsSettings); + ApplyUpdatesToInstancesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.ApplyUpdatesToInstancesOperationsSettings); + CreateInstancesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.CreateInstancesOperationsSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + DeleteInstancesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteInstancesOperationsSettings); + DeletePerInstanceConfigsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeletePerInstanceConfigsOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.PatchOperationsSettings); + PatchPerInstanceConfigsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.PatchPerInstanceConfigsOperationsSettings); + RecreateInstancesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.RecreateInstancesOperationsSettings); + ResizeOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.ResizeOperationsSettings); + SetInstanceTemplateOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.SetInstanceTemplateOperationsSettings); + SetTargetPoolsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.SetTargetPoolsOperationsSettings); + UpdatePerInstanceConfigsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.UpdatePerInstanceConfigsOperationsSettings); _callAbandonInstances = clientHelper.BuildApiCall(grpcClient.AbandonInstancesAsync, grpcClient.AbandonInstances, effectiveSettings.AbandonInstancesSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("region", request => request.Region).WithGoogleRequestParam("instance_group_manager", request => request.InstanceGroupManager); Modify_ApiCall(ref _callAbandonInstances); Modify_AbandonInstancesApiCall(ref _callAbandonInstances); @@ -2558,6 +3209,9 @@ public RegionInstanceGroupManagersClientImpl(RegionInstanceGroupManagers.RegionI partial void Modify_UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest(ref UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for AbandonInstances. + public override lro::OperationsClient AbandonInstancesOperationsClient { get; } + /// /// Flags the specified instances to be immediately removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. /// @@ -2568,10 +3222,13 @@ public RegionInstanceGroupManagersClientImpl(RegionInstanceGroupManagers.RegionI /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation AbandonInstances(AbandonInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation AbandonInstances(AbandonInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AbandonInstancesRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callAbandonInstances.Sync(request, callSettings); + Operation response = _callAbandonInstances.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AbandonInstancesOperationsClient); } /// @@ -2584,22 +3241,31 @@ public override Operation AbandonInstances(AbandonInstancesRegionInstanceGroupMa /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task AbandonInstancesAsync(AbandonInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> AbandonInstancesAsync(AbandonInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AbandonInstancesRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callAbandonInstances.Async(request, callSettings); + Operation response = await _callAbandonInstances.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AbandonInstancesOperationsClient); } + /// The long-running operations client for ApplyUpdatesToInstances. + public override lro::OperationsClient ApplyUpdatesToInstancesOperationsClient { get; } + /// /// Apply updates to selected instances the managed instance group. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation ApplyUpdatesToInstances(ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation ApplyUpdatesToInstances(ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callApplyUpdatesToInstances.Sync(request, callSettings); + Operation response = _callApplyUpdatesToInstances.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), ApplyUpdatesToInstancesOperationsClient); } /// @@ -2608,22 +3274,31 @@ public override Operation ApplyUpdatesToInstances(ApplyUpdatesToInstancesRegionI /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task ApplyUpdatesToInstancesAsync(ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> ApplyUpdatesToInstancesAsync(ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callApplyUpdatesToInstances.Async(request, callSettings); + Operation response = await _callApplyUpdatesToInstances.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), ApplyUpdatesToInstancesOperationsClient); } + /// The long-running operations client for CreateInstances. + public override lro::OperationsClient CreateInstancesOperationsClient { get; } + /// /// Creates instances with per-instance configs in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation CreateInstances(CreateInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation CreateInstances(CreateInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_CreateInstancesRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callCreateInstances.Sync(request, callSettings); + Operation response = _callCreateInstances.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), CreateInstancesOperationsClient); } /// @@ -2632,22 +3307,31 @@ public override Operation CreateInstances(CreateInstancesRegionInstanceGroupMana /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task CreateInstancesAsync(CreateInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> CreateInstancesAsync(CreateInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_CreateInstancesRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callCreateInstances.Async(request, callSettings); + Operation response = await _callCreateInstances.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), CreateInstancesOperationsClient); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified managed instance group and all of the instances in that group. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -2656,12 +3340,18 @@ public override Operation Delete(DeleteRegionInstanceGroupManagerRequest request /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } + /// The long-running operations client for DeleteInstances. + public override lro::OperationsClient DeleteInstancesOperationsClient { get; } + /// /// Flags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method. /// @@ -2672,10 +3362,13 @@ public override Operation Delete(DeleteRegionInstanceGroupManagerRequest request /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation DeleteInstances(DeleteInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation DeleteInstances(DeleteInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteInstancesRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callDeleteInstances.Sync(request, callSettings); + Operation response = _callDeleteInstances.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteInstancesOperationsClient); } /// @@ -2688,22 +3381,31 @@ public override Operation DeleteInstances(DeleteInstancesRegionInstanceGroupMana /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteInstancesAsync(DeleteInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteInstancesAsync(DeleteInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteInstancesRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callDeleteInstances.Async(request, callSettings); + Operation response = await _callDeleteInstances.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteInstancesOperationsClient); } + /// The long-running operations client for DeletePerInstanceConfigs. + public override lro::OperationsClient DeletePerInstanceConfigsOperationsClient { get; } + /// /// Deletes selected per-instance configs for the managed instance group. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation DeletePerInstanceConfigs(DeletePerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation DeletePerInstanceConfigs(DeletePerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeletePerInstanceConfigsRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callDeletePerInstanceConfigs.Sync(request, callSettings); + Operation response = _callDeletePerInstanceConfigs.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeletePerInstanceConfigsOperationsClient); } /// @@ -2712,10 +3414,13 @@ public override Operation DeletePerInstanceConfigs(DeletePerInstanceConfigsRegio /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeletePerInstanceConfigsAsync(DeletePerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeletePerInstanceConfigsAsync(DeletePerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeletePerInstanceConfigsRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callDeletePerInstanceConfigs.Async(request, callSettings); + Operation response = await _callDeletePerInstanceConfigs.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeletePerInstanceConfigsOperationsClient); } /// @@ -2742,6 +3447,9 @@ public override InstanceGroupManager Get(GetRegionInstanceGroupManagerRequest re return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. /// @@ -2750,10 +3458,13 @@ public override InstanceGroupManager Get(GetRegionInstanceGroupManagerRequest re /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -2764,10 +3475,13 @@ public override Operation Insert(InsertRegionInstanceGroupManagerRequest request /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -2866,16 +3580,22 @@ public override Operation Insert(InsertRegionInstanceGroupManagerRequest request return new gaxgrpc::GrpcPagedAsyncEnumerable(_callListPerInstanceConfigs, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -2884,22 +3604,31 @@ public override Operation Patch(PatchRegionInstanceGroupManagerRequest request, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } + /// The long-running operations client for PatchPerInstanceConfigs. + public override lro::OperationsClient PatchPerInstanceConfigsOperationsClient { get; } + /// /// Inserts or patches per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation PatchPerInstanceConfigs(PatchPerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation PatchPerInstanceConfigs(PatchPerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchPerInstanceConfigsRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callPatchPerInstanceConfigs.Sync(request, callSettings); + Operation response = _callPatchPerInstanceConfigs.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchPerInstanceConfigsOperationsClient); } /// @@ -2908,12 +3637,18 @@ public override Operation PatchPerInstanceConfigs(PatchPerInstanceConfigsRegionI /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchPerInstanceConfigsAsync(PatchPerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchPerInstanceConfigsAsync(PatchPerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchPerInstanceConfigsRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callPatchPerInstanceConfigs.Async(request, callSettings); + Operation response = await _callPatchPerInstanceConfigs.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchPerInstanceConfigsOperationsClient); } + /// The long-running operations client for RecreateInstances. + public override lro::OperationsClient RecreateInstancesOperationsClient { get; } + /// /// Flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group's current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking its currentAction field; for more information, see Checking the status of managed instances. /// @@ -2924,10 +3659,13 @@ public override Operation PatchPerInstanceConfigs(PatchPerInstanceConfigsRegionI /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation RecreateInstances(RecreateInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation RecreateInstances(RecreateInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RecreateInstancesRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callRecreateInstances.Sync(request, callSettings); + Operation response = _callRecreateInstances.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RecreateInstancesOperationsClient); } /// @@ -2940,12 +3678,18 @@ public override Operation RecreateInstances(RecreateInstancesRegionInstanceGroup /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task RecreateInstancesAsync(RecreateInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> RecreateInstancesAsync(RecreateInstancesRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RecreateInstancesRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callRecreateInstances.Async(request, callSettings); + Operation response = await _callRecreateInstances.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RecreateInstancesOperationsClient); } + /// The long-running operations client for Resize. + public override lro::OperationsClient ResizeOperationsClient { get; } + /// /// Changes the intended size of the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes one or more instances. /// @@ -2956,10 +3700,13 @@ public override Operation RecreateInstances(RecreateInstancesRegionInstanceGroup /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Resize(ResizeRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Resize(ResizeRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ResizeRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callResize.Sync(request, callSettings); + Operation response = _callResize.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), ResizeOperationsClient); } /// @@ -2972,22 +3719,31 @@ public override Operation Resize(ResizeRegionInstanceGroupManagerRequest request /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task ResizeAsync(ResizeRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> ResizeAsync(ResizeRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ResizeRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callResize.Async(request, callSettings); + Operation response = await _callResize.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), ResizeOperationsClient); } + /// The long-running operations client for SetInstanceTemplate. + public override lro::OperationsClient SetInstanceTemplateOperationsClient { get; } + /// /// Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetInstanceTemplate(SetInstanceTemplateRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetInstanceTemplate(SetInstanceTemplateRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetInstanceTemplateRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callSetInstanceTemplate.Sync(request, callSettings); + Operation response = _callSetInstanceTemplate.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetInstanceTemplateOperationsClient); } /// @@ -2996,22 +3752,31 @@ public override Operation SetInstanceTemplate(SetInstanceTemplateRegionInstanceG /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetInstanceTemplateAsync(SetInstanceTemplateRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetInstanceTemplateAsync(SetInstanceTemplateRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetInstanceTemplateRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callSetInstanceTemplate.Async(request, callSettings); + Operation response = await _callSetInstanceTemplate.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetInstanceTemplateOperationsClient); } + /// The long-running operations client for SetTargetPools. + public override lro::OperationsClient SetTargetPoolsOperationsClient { get; } + /// /// Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetTargetPools(SetTargetPoolsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetTargetPools(SetTargetPoolsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetTargetPoolsRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callSetTargetPools.Sync(request, callSettings); + Operation response = _callSetTargetPools.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetTargetPoolsOperationsClient); } /// @@ -3020,22 +3785,31 @@ public override Operation SetTargetPools(SetTargetPoolsRegionInstanceGroupManage /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetTargetPoolsAsync(SetTargetPoolsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetTargetPoolsAsync(SetTargetPoolsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetTargetPoolsRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callSetTargetPools.Async(request, callSettings); + Operation response = await _callSetTargetPools.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetTargetPoolsOperationsClient); } + /// The long-running operations client for UpdatePerInstanceConfigs. + public override lro::OperationsClient UpdatePerInstanceConfigsOperationsClient { get; } + /// /// Inserts or updates per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation UpdatePerInstanceConfigs(UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation UpdatePerInstanceConfigs(UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callUpdatePerInstanceConfigs.Sync(request, callSettings); + Operation response = _callUpdatePerInstanceConfigs.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdatePerInstanceConfigsOperationsClient); } /// @@ -3044,10 +3818,13 @@ public override Operation UpdatePerInstanceConfigs(UpdatePerInstanceConfigsRegio /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task UpdatePerInstanceConfigsAsync(UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> UpdatePerInstanceConfigsAsync(UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest(ref request, ref callSettings); - return _callUpdatePerInstanceConfigs.Async(request, callSettings); + Operation response = await _callUpdatePerInstanceConfigs.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdatePerInstanceConfigsOperationsClient); } } @@ -3122,4 +3899,18 @@ public partial class RegionInstanceGroupManagersListInstanceConfigsResp : gaxgrp sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class RegionInstanceGroupManagers + { + public partial class RegionInstanceGroupManagersClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionInstanceGroupsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionInstanceGroupsClient.g.cs index 5aefbc2d00ab..add64022b534 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionInstanceGroupsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionInstanceGroupsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -48,6 +49,7 @@ private RegionInstanceGroupsSettings(RegionInstanceGroupsSettings existing) : ba ListSettings = existing.ListSettings; ListInstancesSettings = existing.ListInstancesSettings; SetNamedPortsSettings = existing.SetNamedPortsSettings; + SetNamedPortsOperationsSettings = existing.SetNamedPortsOperationsSettings.Clone(); OnCopy(existing); } @@ -101,6 +103,24 @@ private RegionInstanceGroupsSettings(RegionInstanceGroupsSettings existing) : ba /// public gaxgrpc::CallSettings SetNamedPortsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionInstanceGroupsClient.SetNamedPorts and + /// RegionInstanceGroupsClient.SetNamedPortsAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetNamedPortsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public RegionInstanceGroupsSettings Clone() => new RegionInstanceGroupsSettings(this); @@ -525,7 +545,7 @@ internal static RegionInstanceGroupsClient Create(grpccore::CallInvoker callInvo /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetNamedPorts(SetNamedPortsRegionInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetNamedPorts(SetNamedPortsRegionInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -534,7 +554,7 @@ internal static RegionInstanceGroupsClient Create(grpccore::CallInvoker callInvo /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetNamedPortsAsync(SetNamedPortsRegionInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetNamedPortsAsync(SetNamedPortsRegionInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -543,9 +563,35 @@ internal static RegionInstanceGroupsClient Create(grpccore::CallInvoker callInvo /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetNamedPortsAsync(SetNamedPortsRegionInstanceGroupRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetNamedPortsAsync(SetNamedPortsRegionInstanceGroupRequest request, st::CancellationToken cancellationToken) => SetNamedPortsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetNamedPorts. + public virtual lro::OperationsClient SetNamedPortsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetNamedPorts. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetNamedPorts(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetNamedPortsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetNamedPorts. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetNamedPortsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetNamedPortsOperationsClient, callSettings); + /// /// Sets the named ports for the specified regional instance group. /// @@ -563,7 +609,7 @@ internal static RegionInstanceGroupsClient Create(grpccore::CallInvoker callInvo /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetNamedPorts(string project, string region, string instanceGroup, RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetNamedPorts(string project, string region, string instanceGroup, RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetNamedPorts(new SetNamedPortsRegionInstanceGroupRequest { InstanceGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroup, nameof(instanceGroup)), @@ -589,7 +635,7 @@ internal static RegionInstanceGroupsClient Create(grpccore::CallInvoker callInvo /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetNamedPortsAsync(string project, string region, string instanceGroup, RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetNamedPortsAsync(string project, string region, string instanceGroup, RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetNamedPortsAsync(new SetNamedPortsRegionInstanceGroupRequest { InstanceGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(instanceGroup, nameof(instanceGroup)), @@ -615,7 +661,7 @@ internal static RegionInstanceGroupsClient Create(grpccore::CallInvoker callInvo /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetNamedPortsAsync(string project, string region, string instanceGroup, RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetNamedPortsAsync(string project, string region, string instanceGroup, RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource, st::CancellationToken cancellationToken) => SetNamedPortsAsync(project, region, instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -644,6 +690,7 @@ public RegionInstanceGroupsClientImpl(RegionInstanceGroups.RegionInstanceGroupsC GrpcClient = grpcClient; RegionInstanceGroupsSettings effectiveSettings = settings ?? RegionInstanceGroupsSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + SetNamedPortsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.SetNamedPortsOperationsSettings); _callGet = clientHelper.BuildApiCall(grpcClient.GetAsync, grpcClient.Get, effectiveSettings.GetSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("region", request => request.Region).WithGoogleRequestParam("instance_group", request => request.InstanceGroup); Modify_ApiCall(ref _callGet); Modify_GetApiCall(ref _callGet); @@ -754,16 +801,22 @@ public override InstanceGroup Get(GetRegionInstanceGroupRequest request, gaxgrpc return new gaxgrpc::GrpcPagedAsyncEnumerable(_callListInstances, request, callSettings); } + /// The long-running operations client for SetNamedPorts. + public override lro::OperationsClient SetNamedPortsOperationsClient { get; } + /// /// Sets the named ports for the specified regional instance group. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetNamedPorts(SetNamedPortsRegionInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetNamedPorts(SetNamedPortsRegionInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetNamedPortsRegionInstanceGroupRequest(ref request, ref callSettings); - return _callSetNamedPorts.Sync(request, callSettings); + Operation response = _callSetNamedPorts.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetNamedPortsOperationsClient); } /// @@ -772,10 +825,13 @@ public override Operation SetNamedPorts(SetNamedPortsRegionInstanceGroupRequest /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetNamedPortsAsync(SetNamedPortsRegionInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetNamedPortsAsync(SetNamedPortsRegionInstanceGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetNamedPortsRegionInstanceGroupRequest(ref request, ref callSettings); - return _callSetNamedPorts.Async(request, callSettings); + Operation response = await _callSetNamedPorts.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetNamedPortsOperationsClient); } } @@ -814,4 +870,18 @@ public partial class RegionInstanceGroupsListInstances : gaxgrpc::IPageResponse< sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class RegionInstanceGroups + { + public partial class RegionInstanceGroupsClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionInstancesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionInstancesClient.g.cs index d9197a32c88c..50badd937bda 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionInstancesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionInstancesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -44,6 +45,7 @@ private RegionInstancesSettings(RegionInstancesSettings existing) : base(existin { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); BulkInsertSettings = existing.BulkInsertSettings; + BulkInsertOperationsSettings = existing.BulkInsertOperationsSettings.Clone(); OnCopy(existing); } @@ -61,6 +63,24 @@ private RegionInstancesSettings(RegionInstancesSettings existing) : base(existin /// public gaxgrpc::CallSettings BulkInsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionInstancesClient.BulkInsert and + /// RegionInstancesClient.BulkInsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings BulkInsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public RegionInstancesSettings Clone() => new RegionInstancesSettings(this); @@ -230,7 +250,7 @@ internal static RegionInstancesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation BulkInsert(BulkInsertRegionInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation BulkInsert(BulkInsertRegionInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -239,7 +259,7 @@ internal static RegionInstancesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task BulkInsertAsync(BulkInsertRegionInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> BulkInsertAsync(BulkInsertRegionInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -248,9 +268,35 @@ internal static RegionInstancesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task BulkInsertAsync(BulkInsertRegionInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> BulkInsertAsync(BulkInsertRegionInstanceRequest request, st::CancellationToken cancellationToken) => BulkInsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for BulkInsert. + public virtual lro::OperationsClient BulkInsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of BulkInsert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceBulkInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), BulkInsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// BulkInsert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceBulkInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), BulkInsertOperationsClient, callSettings); + /// /// Creates multiple instances in a given region. Count specifies the number of instances to create. /// @@ -265,7 +311,7 @@ internal static RegionInstancesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation BulkInsert(string project, string region, BulkInsertInstanceResource bulkInsertInstanceResourceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation BulkInsert(string project, string region, BulkInsertInstanceResource bulkInsertInstanceResourceResource, gaxgrpc::CallSettings callSettings = null) => BulkInsert(new BulkInsertRegionInstanceRequest { BulkInsertInstanceResourceResource = gax::GaxPreconditions.CheckNotNull(bulkInsertInstanceResourceResource, nameof(bulkInsertInstanceResourceResource)), @@ -287,7 +333,7 @@ internal static RegionInstancesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task BulkInsertAsync(string project, string region, BulkInsertInstanceResource bulkInsertInstanceResourceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> BulkInsertAsync(string project, string region, BulkInsertInstanceResource bulkInsertInstanceResourceResource, gaxgrpc::CallSettings callSettings = null) => BulkInsertAsync(new BulkInsertRegionInstanceRequest { BulkInsertInstanceResourceResource = gax::GaxPreconditions.CheckNotNull(bulkInsertInstanceResourceResource, nameof(bulkInsertInstanceResourceResource)), @@ -309,7 +355,7 @@ internal static RegionInstancesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task BulkInsertAsync(string project, string region, BulkInsertInstanceResource bulkInsertInstanceResourceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> BulkInsertAsync(string project, string region, BulkInsertInstanceResource bulkInsertInstanceResourceResource, st::CancellationToken cancellationToken) => BulkInsertAsync(project, region, bulkInsertInstanceResourceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -331,6 +377,7 @@ public RegionInstancesClientImpl(RegionInstances.RegionInstancesClient grpcClien GrpcClient = grpcClient; RegionInstancesSettings effectiveSettings = settings ?? RegionInstancesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + BulkInsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.BulkInsertOperationsSettings); _callBulkInsert = clientHelper.BuildApiCall(grpcClient.BulkInsertAsync, grpcClient.BulkInsert, effectiveSettings.BulkInsertSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("region", request => request.Region); Modify_ApiCall(ref _callBulkInsert); Modify_BulkInsertApiCall(ref _callBulkInsert); @@ -348,16 +395,22 @@ public RegionInstancesClientImpl(RegionInstances.RegionInstancesClient grpcClien partial void Modify_BulkInsertRegionInstanceRequest(ref BulkInsertRegionInstanceRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for BulkInsert. + public override lro::OperationsClient BulkInsertOperationsClient { get; } + /// /// Creates multiple instances in a given region. Count specifies the number of instances to create. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation BulkInsert(BulkInsertRegionInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation BulkInsert(BulkInsertRegionInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_BulkInsertRegionInstanceRequest(ref request, ref callSettings); - return _callBulkInsert.Sync(request, callSettings); + Operation response = _callBulkInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), BulkInsertOperationsClient); } /// @@ -366,10 +419,27 @@ public override Operation BulkInsert(BulkInsertRegionInstanceRequest request, ga /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task BulkInsertAsync(BulkInsertRegionInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> BulkInsertAsync(BulkInsertRegionInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_BulkInsertRegionInstanceRequest(ref request, ref callSettings); - return _callBulkInsert.Async(request, callSettings); + Operation response = await _callBulkInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), BulkInsertOperationsClient); + } + } + + public static partial class RegionInstances + { + public partial class RegionInstancesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); } } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionNetworkEndpointGroupsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionNetworkEndpointGroupsClient.g.cs index d170a9a24661..6c736d5aaa8c 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionNetworkEndpointGroupsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionNetworkEndpointGroupsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -46,8 +47,10 @@ private RegionNetworkEndpointGroupsSettings(RegionNetworkEndpointGroupsSettings { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; OnCopy(existing); } @@ -66,6 +69,24 @@ private RegionNetworkEndpointGroupsSettings(RegionNetworkEndpointGroupsSettings /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionNetworkEndpointGroupsClient.Delete and + /// RegionNetworkEndpointGroupsClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionNetworkEndpointGroupsClient.Get and RegionNetworkEndpointGroupsClient.GetAsync. @@ -90,6 +111,24 @@ private RegionNetworkEndpointGroupsSettings(RegionNetworkEndpointGroupsSettings /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionNetworkEndpointGroupsClient.Insert and + /// RegionNetworkEndpointGroupsClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionNetworkEndpointGroupsClient.List and RegionNetworkEndpointGroupsClient.ListAsync. @@ -274,7 +313,7 @@ internal static RegionNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteRegionNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteRegionNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -283,7 +322,7 @@ internal static RegionNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteRegionNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -292,9 +331,35 @@ internal static RegionNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionNetworkEndpointGroupRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteRegionNetworkEndpointGroupRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified network endpoint group. Note that the NEG cannot be deleted if it is configured as a backend of a backend service. /// @@ -309,7 +374,7 @@ internal static RegionNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string networkEndpointGroup, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string networkEndpointGroup, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteRegionNetworkEndpointGroupRequest { NetworkEndpointGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(networkEndpointGroup, nameof(networkEndpointGroup)), @@ -331,7 +396,7 @@ internal static RegionNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string networkEndpointGroup, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string networkEndpointGroup, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteRegionNetworkEndpointGroupRequest { NetworkEndpointGroup = gax::GaxPreconditions.CheckNotNullOrEmpty(networkEndpointGroup, nameof(networkEndpointGroup)), @@ -353,7 +418,7 @@ internal static RegionNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string networkEndpointGroup, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string networkEndpointGroup, st::CancellationToken cancellationToken) => DeleteAsync(project, region, networkEndpointGroup, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -450,7 +515,7 @@ internal static RegionNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertRegionNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertRegionNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -459,7 +524,7 @@ internal static RegionNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertRegionNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -468,9 +533,35 @@ internal static RegionNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionNetworkEndpointGroupRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertRegionNetworkEndpointGroupRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a network endpoint group in the specified project using the parameters that are included in the request. /// @@ -485,7 +576,7 @@ internal static RegionNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, NetworkEndpointGroup networkEndpointGroupResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, NetworkEndpointGroup networkEndpointGroupResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertRegionNetworkEndpointGroupRequest { NetworkEndpointGroupResource = gax::GaxPreconditions.CheckNotNull(networkEndpointGroupResource, nameof(networkEndpointGroupResource)), @@ -507,7 +598,7 @@ internal static RegionNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, NetworkEndpointGroup networkEndpointGroupResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, NetworkEndpointGroup networkEndpointGroupResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertRegionNetworkEndpointGroupRequest { NetworkEndpointGroupResource = gax::GaxPreconditions.CheckNotNull(networkEndpointGroupResource, nameof(networkEndpointGroupResource)), @@ -529,7 +620,7 @@ internal static RegionNetworkEndpointGroupsClient Create(grpccore::CallInvoker c /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, NetworkEndpointGroup networkEndpointGroupResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, NetworkEndpointGroup networkEndpointGroupResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, networkEndpointGroupResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -634,6 +725,8 @@ public RegionNetworkEndpointGroupsClientImpl(RegionNetworkEndpointGroups.RegionN GrpcClient = grpcClient; RegionNetworkEndpointGroupsSettings effectiveSettings = settings ?? RegionNetworkEndpointGroupsSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("region", request => request.Region).WithGoogleRequestParam("network_endpoint_group", request => request.NetworkEndpointGroup); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -672,16 +765,22 @@ public RegionNetworkEndpointGroupsClientImpl(RegionNetworkEndpointGroups.RegionN partial void Modify_ListRegionNetworkEndpointGroupsRequest(ref ListRegionNetworkEndpointGroupsRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified network endpoint group. Note that the NEG cannot be deleted if it is configured as a backend of a backend service. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteRegionNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteRegionNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionNetworkEndpointGroupRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -690,10 +789,13 @@ public override Operation Delete(DeleteRegionNetworkEndpointGroupRequest request /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteRegionNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteRegionNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionNetworkEndpointGroupRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -720,16 +822,22 @@ public override NetworkEndpointGroup Get(GetRegionNetworkEndpointGroupRequest re return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a network endpoint group in the specified project using the parameters that are included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertRegionNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertRegionNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionNetworkEndpointGroupRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -738,10 +846,13 @@ public override Operation Insert(InsertRegionNetworkEndpointGroupRequest request /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertRegionNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertRegionNetworkEndpointGroupRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionNetworkEndpointGroupRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -778,4 +889,18 @@ public int PageSize set => MaxResults = checked((uint)value); } } + + public static partial class RegionNetworkEndpointGroups + { + public partial class RegionNetworkEndpointGroupsClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionNotificationEndpointsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionNotificationEndpointsClient.g.cs index 8859abbcceac..1f326f69da57 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionNotificationEndpointsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionNotificationEndpointsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -47,8 +48,10 @@ private RegionNotificationEndpointsSettings(RegionNotificationEndpointsSettings { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; OnCopy(existing); } @@ -67,6 +70,24 @@ private RegionNotificationEndpointsSettings(RegionNotificationEndpointsSettings /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionNotificationEndpointsClient.Delete and + /// RegionNotificationEndpointsClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionNotificationEndpointsClient.Get and RegionNotificationEndpointsClient.GetAsync. @@ -91,6 +112,24 @@ private RegionNotificationEndpointsSettings(RegionNotificationEndpointsSettings /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionNotificationEndpointsClient.Insert and + /// RegionNotificationEndpointsClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionNotificationEndpointsClient.List and RegionNotificationEndpointsClient.ListAsync. @@ -275,7 +314,7 @@ internal static RegionNotificationEndpointsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteRegionNotificationEndpointRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteRegionNotificationEndpointRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -284,7 +323,7 @@ internal static RegionNotificationEndpointsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionNotificationEndpointRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteRegionNotificationEndpointRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -293,9 +332,35 @@ internal static RegionNotificationEndpointsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionNotificationEndpointRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteRegionNotificationEndpointRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified NotificationEndpoint in the given region /// @@ -310,7 +375,7 @@ internal static RegionNotificationEndpointsClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string notificationEndpoint, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string notificationEndpoint, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteRegionNotificationEndpointRequest { NotificationEndpoint = gax::GaxPreconditions.CheckNotNullOrEmpty(notificationEndpoint, nameof(notificationEndpoint)), @@ -332,7 +397,7 @@ internal static RegionNotificationEndpointsClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string notificationEndpoint, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string notificationEndpoint, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteRegionNotificationEndpointRequest { NotificationEndpoint = gax::GaxPreconditions.CheckNotNullOrEmpty(notificationEndpoint, nameof(notificationEndpoint)), @@ -354,7 +419,7 @@ internal static RegionNotificationEndpointsClient Create(grpccore::CallInvoker c /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string notificationEndpoint, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string notificationEndpoint, st::CancellationToken cancellationToken) => DeleteAsync(project, region, notificationEndpoint, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -451,7 +516,7 @@ internal static RegionNotificationEndpointsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertRegionNotificationEndpointRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertRegionNotificationEndpointRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -460,7 +525,7 @@ internal static RegionNotificationEndpointsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionNotificationEndpointRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertRegionNotificationEndpointRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -469,9 +534,35 @@ internal static RegionNotificationEndpointsClient Create(grpccore::CallInvoker c /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionNotificationEndpointRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertRegionNotificationEndpointRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Create a NotificationEndpoint in the specified project in the given region using the parameters that are included in the request. /// @@ -486,7 +577,7 @@ internal static RegionNotificationEndpointsClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, NotificationEndpoint notificationEndpointResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, NotificationEndpoint notificationEndpointResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertRegionNotificationEndpointRequest { NotificationEndpointResource = gax::GaxPreconditions.CheckNotNull(notificationEndpointResource, nameof(notificationEndpointResource)), @@ -508,7 +599,7 @@ internal static RegionNotificationEndpointsClient Create(grpccore::CallInvoker c /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, NotificationEndpoint notificationEndpointResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, NotificationEndpoint notificationEndpointResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertRegionNotificationEndpointRequest { NotificationEndpointResource = gax::GaxPreconditions.CheckNotNull(notificationEndpointResource, nameof(notificationEndpointResource)), @@ -530,7 +621,7 @@ internal static RegionNotificationEndpointsClient Create(grpccore::CallInvoker c /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, NotificationEndpoint notificationEndpointResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, NotificationEndpoint notificationEndpointResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, notificationEndpointResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -635,6 +726,8 @@ public RegionNotificationEndpointsClientImpl(RegionNotificationEndpoints.RegionN GrpcClient = grpcClient; RegionNotificationEndpointsSettings effectiveSettings = settings ?? RegionNotificationEndpointsSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("region", request => request.Region).WithGoogleRequestParam("notification_endpoint", request => request.NotificationEndpoint); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -673,16 +766,22 @@ public RegionNotificationEndpointsClientImpl(RegionNotificationEndpoints.RegionN partial void Modify_ListRegionNotificationEndpointsRequest(ref ListRegionNotificationEndpointsRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified NotificationEndpoint in the given region /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteRegionNotificationEndpointRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteRegionNotificationEndpointRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionNotificationEndpointRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -691,10 +790,13 @@ public override Operation Delete(DeleteRegionNotificationEndpointRequest request /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteRegionNotificationEndpointRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteRegionNotificationEndpointRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionNotificationEndpointRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -721,16 +823,22 @@ public override NotificationEndpoint Get(GetRegionNotificationEndpointRequest re return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Create a NotificationEndpoint in the specified project in the given region using the parameters that are included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertRegionNotificationEndpointRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertRegionNotificationEndpointRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionNotificationEndpointRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -739,10 +847,13 @@ public override Operation Insert(InsertRegionNotificationEndpointRequest request /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertRegionNotificationEndpointRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertRegionNotificationEndpointRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionNotificationEndpointRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -787,4 +898,18 @@ public partial class NotificationEndpointList : gaxgrpc::IPageResponse GetEnumerator(); } + + public static partial class RegionNotificationEndpoints + { + public partial class RegionNotificationEndpointsClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionOperationsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionOperationsClient.g.cs index c8805f4ee383..ba526b2a7c9b 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionOperationsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionOperationsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -802,4 +803,21 @@ public int PageSize set => MaxResults = checked((uint)value); } } + + public static partial class RegionOperations + { + public partial class RegionOperationsClient + { + /// + /// Creates a new instance of using the specified call + /// invoker, but redirecting Google.LongRunning RPCs to RegionOperations RPCs. + /// + /// A new Operations client for the same target as this client. + internal static lro::Operations.OperationsClient CreateOperationsClient(grpccore::CallInvoker callInvoker) + { + grpccore::CallInvoker forwardingCallInvoker = gaxgrpc::ForwardingCallInvoker.Create(callInvoker, "/google.longrunning.Operations/GetOperation", __Method_Get, GetRegionOperationRequest.ParseLroRequest, (request, response) => response.ToLroResponse(request.Name)); + return new lro::Operations.OperationsClient(forwardingCallInvoker); + } + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionSslCertificatesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionSslCertificatesClient.g.cs index ec64dd6e3cd7..ec5d82580a5e 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionSslCertificatesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionSslCertificatesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -47,8 +48,10 @@ private RegionSslCertificatesSettings(RegionSslCertificatesSettings existing) : { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; OnCopy(existing); } @@ -67,6 +70,24 @@ private RegionSslCertificatesSettings(RegionSslCertificatesSettings existing) : /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionSslCertificatesClient.Delete and + /// RegionSslCertificatesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionSslCertificatesClient.Get and RegionSslCertificatesClient.GetAsync. @@ -91,6 +112,24 @@ private RegionSslCertificatesSettings(RegionSslCertificatesSettings existing) : /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionSslCertificatesClient.Insert and + /// RegionSslCertificatesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionSslCertificatesClient.List and RegionSslCertificatesClient.ListAsync. @@ -275,7 +314,7 @@ internal static RegionSslCertificatesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteRegionSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteRegionSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -284,7 +323,7 @@ internal static RegionSslCertificatesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteRegionSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -293,9 +332,35 @@ internal static RegionSslCertificatesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionSslCertificateRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteRegionSslCertificateRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified SslCertificate resource in the region. /// @@ -310,7 +375,7 @@ internal static RegionSslCertificatesClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string sslCertificate, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string sslCertificate, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteRegionSslCertificateRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -332,7 +397,7 @@ internal static RegionSslCertificatesClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string sslCertificate, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string sslCertificate, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteRegionSslCertificateRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -354,7 +419,7 @@ internal static RegionSslCertificatesClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string sslCertificate, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string sslCertificate, st::CancellationToken cancellationToken) => DeleteAsync(project, region, sslCertificate, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -451,7 +516,7 @@ internal static RegionSslCertificatesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertRegionSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertRegionSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -460,7 +525,7 @@ internal static RegionSslCertificatesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertRegionSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -469,9 +534,35 @@ internal static RegionSslCertificatesClient Create(grpccore::CallInvoker callInv /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionSslCertificateRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertRegionSslCertificateRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a SslCertificate resource in the specified project and region using the data included in the request /// @@ -486,7 +577,7 @@ internal static RegionSslCertificatesClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, SslCertificate sslCertificateResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, SslCertificate sslCertificateResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertRegionSslCertificateRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -508,7 +599,7 @@ internal static RegionSslCertificatesClient Create(grpccore::CallInvoker callInv /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, SslCertificate sslCertificateResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, SslCertificate sslCertificateResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertRegionSslCertificateRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -530,7 +621,7 @@ internal static RegionSslCertificatesClient Create(grpccore::CallInvoker callInv /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, SslCertificate sslCertificateResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, SslCertificate sslCertificateResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, sslCertificateResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -633,6 +724,8 @@ public RegionSslCertificatesClientImpl(RegionSslCertificates.RegionSslCertificat GrpcClient = grpcClient; RegionSslCertificatesSettings effectiveSettings = settings ?? RegionSslCertificatesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("region", request => request.Region).WithGoogleRequestParam("ssl_certificate", request => request.SslCertificate); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -671,16 +764,22 @@ public RegionSslCertificatesClientImpl(RegionSslCertificates.RegionSslCertificat partial void Modify_ListRegionSslCertificatesRequest(ref ListRegionSslCertificatesRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified SslCertificate resource in the region. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteRegionSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteRegionSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionSslCertificateRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -689,10 +788,13 @@ public override Operation Delete(DeleteRegionSslCertificateRequest request, gaxg /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteRegionSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteRegionSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionSslCertificateRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -719,16 +821,22 @@ public override SslCertificate Get(GetRegionSslCertificateRequest request, gaxgr return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a SslCertificate resource in the specified project and region using the data included in the request /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertRegionSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertRegionSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionSslCertificateRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -737,10 +845,13 @@ public override Operation Insert(InsertRegionSslCertificateRequest request, gaxg /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertRegionSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertRegionSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionSslCertificateRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -785,4 +896,18 @@ public partial class SslCertificateList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class RegionSslCertificates + { + public partial class RegionSslCertificatesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionTargetHttpProxiesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionTargetHttpProxiesClient.g.cs index 190af37a8d60..701ca070cd3f 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionTargetHttpProxiesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionTargetHttpProxiesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -47,10 +48,13 @@ private RegionTargetHttpProxiesSettings(RegionTargetHttpProxiesSettings existing { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; SetUrlMapSettings = existing.SetUrlMapSettings; + SetUrlMapOperationsSettings = existing.SetUrlMapOperationsSettings.Clone(); OnCopy(existing); } @@ -68,6 +72,24 @@ private RegionTargetHttpProxiesSettings(RegionTargetHttpProxiesSettings existing /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionTargetHttpProxiesClient.Delete and + /// RegionTargetHttpProxiesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionTargetHttpProxiesClient.Get and RegionTargetHttpProxiesClient.GetAsync. @@ -92,6 +114,24 @@ private RegionTargetHttpProxiesSettings(RegionTargetHttpProxiesSettings existing /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionTargetHttpProxiesClient.Insert and + /// RegionTargetHttpProxiesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionTargetHttpProxiesClient.List and RegionTargetHttpProxiesClient.ListAsync. @@ -116,6 +156,24 @@ private RegionTargetHttpProxiesSettings(RegionTargetHttpProxiesSettings existing /// public gaxgrpc::CallSettings SetUrlMapSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionTargetHttpProxiesClient.SetUrlMap and + /// RegionTargetHttpProxiesClient.SetUrlMapAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetUrlMapOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public RegionTargetHttpProxiesSettings Clone() => new RegionTargetHttpProxiesSettings(this); @@ -288,7 +346,7 @@ internal static RegionTargetHttpProxiesClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -297,7 +355,7 @@ internal static RegionTargetHttpProxiesClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -306,9 +364,35 @@ internal static RegionTargetHttpProxiesClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionTargetHttpProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteRegionTargetHttpProxyRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified TargetHttpProxy resource. /// @@ -323,7 +407,7 @@ internal static RegionTargetHttpProxiesClient Create(grpccore::CallInvoker callI /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string targetHttpProxy, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string targetHttpProxy, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteRegionTargetHttpProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -345,7 +429,7 @@ internal static RegionTargetHttpProxiesClient Create(grpccore::CallInvoker callI /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string targetHttpProxy, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string targetHttpProxy, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteRegionTargetHttpProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -367,7 +451,7 @@ internal static RegionTargetHttpProxiesClient Create(grpccore::CallInvoker callI /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string targetHttpProxy, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string targetHttpProxy, st::CancellationToken cancellationToken) => DeleteAsync(project, region, targetHttpProxy, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -464,7 +548,7 @@ internal static RegionTargetHttpProxiesClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -473,7 +557,7 @@ internal static RegionTargetHttpProxiesClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -482,9 +566,35 @@ internal static RegionTargetHttpProxiesClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionTargetHttpProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertRegionTargetHttpProxyRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a TargetHttpProxy resource in the specified project and region using the data included in the request. /// @@ -499,7 +609,7 @@ internal static RegionTargetHttpProxiesClient Create(grpccore::CallInvoker callI /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, TargetHttpProxy targetHttpProxyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, TargetHttpProxy targetHttpProxyResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertRegionTargetHttpProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -521,7 +631,7 @@ internal static RegionTargetHttpProxiesClient Create(grpccore::CallInvoker callI /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, TargetHttpProxy targetHttpProxyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, TargetHttpProxy targetHttpProxyResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertRegionTargetHttpProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -543,7 +653,7 @@ internal static RegionTargetHttpProxiesClient Create(grpccore::CallInvoker callI /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, TargetHttpProxy targetHttpProxyResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, TargetHttpProxy targetHttpProxyResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, targetHttpProxyResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -626,7 +736,7 @@ internal static RegionTargetHttpProxiesClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetUrlMap(SetUrlMapRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetUrlMap(SetUrlMapRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -635,7 +745,7 @@ internal static RegionTargetHttpProxiesClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetUrlMapAsync(SetUrlMapRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetUrlMapAsync(SetUrlMapRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -644,9 +754,35 @@ internal static RegionTargetHttpProxiesClient Create(grpccore::CallInvoker callI /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetUrlMapAsync(SetUrlMapRegionTargetHttpProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetUrlMapAsync(SetUrlMapRegionTargetHttpProxyRequest request, st::CancellationToken cancellationToken) => SetUrlMapAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetUrlMap. + public virtual lro::OperationsClient SetUrlMapOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetUrlMap. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetUrlMap(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetUrlMapOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetUrlMap. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetUrlMapAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetUrlMapOperationsClient, callSettings); + /// /// Changes the URL map for TargetHttpProxy. /// @@ -664,7 +800,7 @@ internal static RegionTargetHttpProxiesClient Create(grpccore::CallInvoker callI /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetUrlMap(string project, string region, string targetHttpProxy, UrlMapReference urlMapReferenceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetUrlMap(string project, string region, string targetHttpProxy, UrlMapReference urlMapReferenceResource, gaxgrpc::CallSettings callSettings = null) => SetUrlMap(new SetUrlMapRegionTargetHttpProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -690,7 +826,7 @@ internal static RegionTargetHttpProxiesClient Create(grpccore::CallInvoker callI /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetUrlMapAsync(string project, string region, string targetHttpProxy, UrlMapReference urlMapReferenceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetUrlMapAsync(string project, string region, string targetHttpProxy, UrlMapReference urlMapReferenceResource, gaxgrpc::CallSettings callSettings = null) => SetUrlMapAsync(new SetUrlMapRegionTargetHttpProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -716,7 +852,7 @@ internal static RegionTargetHttpProxiesClient Create(grpccore::CallInvoker callI /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetUrlMapAsync(string project, string region, string targetHttpProxy, UrlMapReference urlMapReferenceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetUrlMapAsync(string project, string region, string targetHttpProxy, UrlMapReference urlMapReferenceResource, st::CancellationToken cancellationToken) => SetUrlMapAsync(project, region, targetHttpProxy, urlMapReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -749,6 +885,9 @@ public RegionTargetHttpProxiesClientImpl(RegionTargetHttpProxies.RegionTargetHtt GrpcClient = grpcClient; RegionTargetHttpProxiesSettings effectiveSettings = settings ?? RegionTargetHttpProxiesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); + SetUrlMapOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.SetUrlMapOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("region", request => request.Region).WithGoogleRequestParam("target_http_proxy", request => request.TargetHttpProxy); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -794,16 +933,22 @@ public RegionTargetHttpProxiesClientImpl(RegionTargetHttpProxies.RegionTargetHtt partial void Modify_SetUrlMapRegionTargetHttpProxyRequest(ref SetUrlMapRegionTargetHttpProxyRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified TargetHttpProxy resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionTargetHttpProxyRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -812,10 +957,13 @@ public override Operation Delete(DeleteRegionTargetHttpProxyRequest request, gax /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionTargetHttpProxyRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -842,16 +990,22 @@ public override TargetHttpProxy Get(GetRegionTargetHttpProxyRequest request, gax return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a TargetHttpProxy resource in the specified project and region using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionTargetHttpProxyRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -860,10 +1014,13 @@ public override Operation Insert(InsertRegionTargetHttpProxyRequest request, gax /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionTargetHttpProxyRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -890,16 +1047,22 @@ public override Operation Insert(InsertRegionTargetHttpProxyRequest request, gax return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for SetUrlMap. + public override lro::OperationsClient SetUrlMapOperationsClient { get; } + /// /// Changes the URL map for TargetHttpProxy. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetUrlMap(SetUrlMapRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetUrlMap(SetUrlMapRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetUrlMapRegionTargetHttpProxyRequest(ref request, ref callSettings); - return _callSetUrlMap.Sync(request, callSettings); + Operation response = _callSetUrlMap.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetUrlMapOperationsClient); } /// @@ -908,10 +1071,13 @@ public override Operation SetUrlMap(SetUrlMapRegionTargetHttpProxyRequest reques /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetUrlMapAsync(SetUrlMapRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetUrlMapAsync(SetUrlMapRegionTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetUrlMapRegionTargetHttpProxyRequest(ref request, ref callSettings); - return _callSetUrlMap.Async(request, callSettings); + Operation response = await _callSetUrlMap.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetUrlMapOperationsClient); } } @@ -932,4 +1098,18 @@ public partial class TargetHttpProxyList : gaxgrpc::IPageResponse GetEnumerator(); } + + public static partial class RegionTargetHttpProxies + { + public partial class RegionTargetHttpProxiesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionTargetHttpsProxiesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionTargetHttpsProxiesClient.g.cs index 3e7dc431cb35..5a3e9467f828 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionTargetHttpsProxiesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionTargetHttpsProxiesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -47,11 +48,15 @@ private RegionTargetHttpsProxiesSettings(RegionTargetHttpsProxiesSettings existi { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; SetSslCertificatesSettings = existing.SetSslCertificatesSettings; + SetSslCertificatesOperationsSettings = existing.SetSslCertificatesOperationsSettings.Clone(); SetUrlMapSettings = existing.SetUrlMapSettings; + SetUrlMapOperationsSettings = existing.SetUrlMapOperationsSettings.Clone(); OnCopy(existing); } @@ -69,6 +74,24 @@ private RegionTargetHttpsProxiesSettings(RegionTargetHttpsProxiesSettings existi /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionTargetHttpsProxiesClient.Delete and + /// RegionTargetHttpsProxiesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionTargetHttpsProxiesClient.Get and RegionTargetHttpsProxiesClient.GetAsync. @@ -93,6 +116,24 @@ private RegionTargetHttpsProxiesSettings(RegionTargetHttpsProxiesSettings existi /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionTargetHttpsProxiesClient.Insert and + /// RegionTargetHttpsProxiesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionTargetHttpsProxiesClient.List and RegionTargetHttpsProxiesClient.ListAsync. @@ -118,6 +159,24 @@ private RegionTargetHttpsProxiesSettings(RegionTargetHttpsProxiesSettings existi /// public gaxgrpc::CallSettings SetSslCertificatesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionTargetHttpsProxiesClient.SetSslCertificates and + /// RegionTargetHttpsProxiesClient.SetSslCertificatesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetSslCertificatesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionTargetHttpsProxiesClient.SetUrlMap and RegionTargetHttpsProxiesClient.SetUrlMapAsync. @@ -130,6 +189,24 @@ private RegionTargetHttpsProxiesSettings(RegionTargetHttpsProxiesSettings existi /// public gaxgrpc::CallSettings SetUrlMapSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionTargetHttpsProxiesClient.SetUrlMap and + /// RegionTargetHttpsProxiesClient.SetUrlMapAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetUrlMapOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public RegionTargetHttpsProxiesSettings Clone() => new RegionTargetHttpsProxiesSettings(this); @@ -302,7 +379,7 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -311,7 +388,7 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -320,9 +397,35 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionTargetHttpsProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteRegionTargetHttpsProxyRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified TargetHttpsProxy resource. /// @@ -337,7 +440,7 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string targetHttpsProxy, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string targetHttpsProxy, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteRegionTargetHttpsProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -359,7 +462,7 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string targetHttpsProxy, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string targetHttpsProxy, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteRegionTargetHttpsProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -381,7 +484,7 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string targetHttpsProxy, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string targetHttpsProxy, st::CancellationToken cancellationToken) => DeleteAsync(project, region, targetHttpsProxy, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -478,7 +581,7 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -487,7 +590,7 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -496,9 +599,35 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionTargetHttpsProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertRegionTargetHttpsProxyRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a TargetHttpsProxy resource in the specified project and region using the data included in the request. /// @@ -513,7 +642,7 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, TargetHttpsProxy targetHttpsProxyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, TargetHttpsProxy targetHttpsProxyResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertRegionTargetHttpsProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -535,7 +664,7 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, TargetHttpsProxy targetHttpsProxyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, TargetHttpsProxy targetHttpsProxyResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertRegionTargetHttpsProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -557,7 +686,7 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, TargetHttpsProxy targetHttpsProxyResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, TargetHttpsProxy targetHttpsProxyResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, targetHttpsProxyResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -640,7 +769,7 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetSslCertificates(SetSslCertificatesRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetSslCertificates(SetSslCertificatesRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -649,7 +778,7 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetSslCertificatesAsync(SetSslCertificatesRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetSslCertificatesAsync(SetSslCertificatesRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -658,9 +787,36 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetSslCertificatesAsync(SetSslCertificatesRegionTargetHttpsProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetSslCertificatesAsync(SetSslCertificatesRegionTargetHttpsProxyRequest request, st::CancellationToken cancellationToken) => SetSslCertificatesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetSslCertificates. + public virtual lro::OperationsClient SetSslCertificatesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetSslCertificates + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetSslCertificates(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetSslCertificatesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetSslCertificates. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetSslCertificatesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetSslCertificatesOperationsClient, callSettings); + /// /// Replaces SslCertificates for TargetHttpsProxy. /// @@ -678,7 +834,7 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetSslCertificates(string project, string region, string targetHttpsProxy, RegionTargetHttpsProxiesSetSslCertificatesRequest regionTargetHttpsProxiesSetSslCertificatesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetSslCertificates(string project, string region, string targetHttpsProxy, RegionTargetHttpsProxiesSetSslCertificatesRequest regionTargetHttpsProxiesSetSslCertificatesRequestResource, gaxgrpc::CallSettings callSettings = null) => SetSslCertificates(new SetSslCertificatesRegionTargetHttpsProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -704,7 +860,7 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetSslCertificatesAsync(string project, string region, string targetHttpsProxy, RegionTargetHttpsProxiesSetSslCertificatesRequest regionTargetHttpsProxiesSetSslCertificatesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetSslCertificatesAsync(string project, string region, string targetHttpsProxy, RegionTargetHttpsProxiesSetSslCertificatesRequest regionTargetHttpsProxiesSetSslCertificatesRequestResource, gaxgrpc::CallSettings callSettings = null) => SetSslCertificatesAsync(new SetSslCertificatesRegionTargetHttpsProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -730,7 +886,7 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetSslCertificatesAsync(string project, string region, string targetHttpsProxy, RegionTargetHttpsProxiesSetSslCertificatesRequest regionTargetHttpsProxiesSetSslCertificatesRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetSslCertificatesAsync(string project, string region, string targetHttpsProxy, RegionTargetHttpsProxiesSetSslCertificatesRequest regionTargetHttpsProxiesSetSslCertificatesRequestResource, st::CancellationToken cancellationToken) => SetSslCertificatesAsync(project, region, targetHttpsProxy, regionTargetHttpsProxiesSetSslCertificatesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -739,7 +895,7 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetUrlMap(SetUrlMapRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetUrlMap(SetUrlMapRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -748,7 +904,7 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetUrlMapAsync(SetUrlMapRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetUrlMapAsync(SetUrlMapRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -757,9 +913,35 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetUrlMapAsync(SetUrlMapRegionTargetHttpsProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetUrlMapAsync(SetUrlMapRegionTargetHttpsProxyRequest request, st::CancellationToken cancellationToken) => SetUrlMapAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetUrlMap. + public virtual lro::OperationsClient SetUrlMapOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetUrlMap. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetUrlMap(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetUrlMapOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetUrlMap. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetUrlMapAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetUrlMapOperationsClient, callSettings); + /// /// Changes the URL map for TargetHttpsProxy. /// @@ -777,7 +959,7 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetUrlMap(string project, string region, string targetHttpsProxy, UrlMapReference urlMapReferenceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetUrlMap(string project, string region, string targetHttpsProxy, UrlMapReference urlMapReferenceResource, gaxgrpc::CallSettings callSettings = null) => SetUrlMap(new SetUrlMapRegionTargetHttpsProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -803,7 +985,7 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetUrlMapAsync(string project, string region, string targetHttpsProxy, UrlMapReference urlMapReferenceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetUrlMapAsync(string project, string region, string targetHttpsProxy, UrlMapReference urlMapReferenceResource, gaxgrpc::CallSettings callSettings = null) => SetUrlMapAsync(new SetUrlMapRegionTargetHttpsProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -829,7 +1011,7 @@ internal static RegionTargetHttpsProxiesClient Create(grpccore::CallInvoker call /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetUrlMapAsync(string project, string region, string targetHttpsProxy, UrlMapReference urlMapReferenceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetUrlMapAsync(string project, string region, string targetHttpsProxy, UrlMapReference urlMapReferenceResource, st::CancellationToken cancellationToken) => SetUrlMapAsync(project, region, targetHttpsProxy, urlMapReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -864,6 +1046,10 @@ public RegionTargetHttpsProxiesClientImpl(RegionTargetHttpsProxies.RegionTargetH GrpcClient = grpcClient; RegionTargetHttpsProxiesSettings effectiveSettings = settings ?? RegionTargetHttpsProxiesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); + SetSslCertificatesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.SetSslCertificatesOperationsSettings); + SetUrlMapOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.SetUrlMapOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("region", request => request.Region).WithGoogleRequestParam("target_https_proxy", request => request.TargetHttpsProxy); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -916,16 +1102,22 @@ public RegionTargetHttpsProxiesClientImpl(RegionTargetHttpsProxies.RegionTargetH partial void Modify_SetUrlMapRegionTargetHttpsProxyRequest(ref SetUrlMapRegionTargetHttpsProxyRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified TargetHttpsProxy resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionTargetHttpsProxyRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -934,10 +1126,13 @@ public override Operation Delete(DeleteRegionTargetHttpsProxyRequest request, ga /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionTargetHttpsProxyRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -964,16 +1159,22 @@ public override TargetHttpsProxy Get(GetRegionTargetHttpsProxyRequest request, g return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a TargetHttpsProxy resource in the specified project and region using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionTargetHttpsProxyRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -982,10 +1183,13 @@ public override Operation Insert(InsertRegionTargetHttpsProxyRequest request, ga /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionTargetHttpsProxyRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1012,16 +1216,22 @@ public override Operation Insert(InsertRegionTargetHttpsProxyRequest request, ga return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for SetSslCertificates. + public override lro::OperationsClient SetSslCertificatesOperationsClient { get; } + /// /// Replaces SslCertificates for TargetHttpsProxy. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetSslCertificates(SetSslCertificatesRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetSslCertificates(SetSslCertificatesRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetSslCertificatesRegionTargetHttpsProxyRequest(ref request, ref callSettings); - return _callSetSslCertificates.Sync(request, callSettings); + Operation response = _callSetSslCertificates.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetSslCertificatesOperationsClient); } /// @@ -1030,22 +1240,31 @@ public override Operation SetSslCertificates(SetSslCertificatesRegionTargetHttps /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetSslCertificatesAsync(SetSslCertificatesRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetSslCertificatesAsync(SetSslCertificatesRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetSslCertificatesRegionTargetHttpsProxyRequest(ref request, ref callSettings); - return _callSetSslCertificates.Async(request, callSettings); + Operation response = await _callSetSslCertificates.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetSslCertificatesOperationsClient); } + /// The long-running operations client for SetUrlMap. + public override lro::OperationsClient SetUrlMapOperationsClient { get; } + /// /// Changes the URL map for TargetHttpsProxy. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetUrlMap(SetUrlMapRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetUrlMap(SetUrlMapRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetUrlMapRegionTargetHttpsProxyRequest(ref request, ref callSettings); - return _callSetUrlMap.Sync(request, callSettings); + Operation response = _callSetUrlMap.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetUrlMapOperationsClient); } /// @@ -1054,10 +1273,13 @@ public override Operation SetUrlMap(SetUrlMapRegionTargetHttpsProxyRequest reque /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetUrlMapAsync(SetUrlMapRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetUrlMapAsync(SetUrlMapRegionTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetUrlMapRegionTargetHttpsProxyRequest(ref request, ref callSettings); - return _callSetUrlMap.Async(request, callSettings); + Operation response = await _callSetUrlMap.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetUrlMapOperationsClient); } } @@ -1078,4 +1300,18 @@ public partial class TargetHttpsProxyList : gaxgrpc::IPageResponse GetEnumerator(); } + + public static partial class RegionTargetHttpsProxies + { + public partial class RegionTargetHttpsProxiesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionUrlMapsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionUrlMapsClient.g.cs index 30257daf3c4e..0a12ce41a6b8 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionUrlMapsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RegionUrlMapsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,11 +46,15 @@ private RegionUrlMapsSettings(RegionUrlMapsSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); UpdateSettings = existing.UpdateSettings; + UpdateOperationsSettings = existing.UpdateOperationsSettings.Clone(); ValidateSettings = existing.ValidateSettings; OnCopy(existing); } @@ -68,6 +73,24 @@ private RegionUrlMapsSettings(RegionUrlMapsSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionUrlMapsClient.Delete and + /// RegionUrlMapsClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to RegionUrlMapsClient.Get /// and RegionUrlMapsClient.GetAsync. @@ -92,6 +115,24 @@ private RegionUrlMapsSettings(RegionUrlMapsSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionUrlMapsClient.Insert and + /// RegionUrlMapsClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to RegionUrlMapsClient.List /// and RegionUrlMapsClient.ListAsync. @@ -116,6 +157,24 @@ private RegionUrlMapsSettings(RegionUrlMapsSettings existing) : base(existing) /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionUrlMapsClient.Patch and + /// RegionUrlMapsClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to RegionUrlMapsClient.Update /// and RegionUrlMapsClient.UpdateAsync. @@ -128,6 +187,24 @@ private RegionUrlMapsSettings(RegionUrlMapsSettings existing) : base(existing) /// public gaxgrpc::CallSettings UpdateSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RegionUrlMapsClient.Update and + /// RegionUrlMapsClient.UpdateAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings UpdateOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// RegionUrlMapsClient.Validate and RegionUrlMapsClient.ValidateAsync. @@ -309,7 +386,7 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -318,7 +395,7 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -327,9 +404,35 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRegionUrlMapRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteRegionUrlMapRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified UrlMap resource. /// @@ -344,7 +447,7 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string urlMap, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string urlMap, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteRegionUrlMapRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -366,7 +469,7 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string urlMap, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string urlMap, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteRegionUrlMapRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -388,7 +491,7 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string urlMap, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string urlMap, st::CancellationToken cancellationToken) => DeleteAsync(project, region, urlMap, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -485,7 +588,7 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -494,7 +597,7 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -503,9 +606,35 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRegionUrlMapRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertRegionUrlMapRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a UrlMap resource in the specified project using the data included in the request. /// @@ -520,7 +649,7 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertRegionUrlMapRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -542,7 +671,7 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertRegionUrlMapRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -564,7 +693,7 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, UrlMap urlMapResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, UrlMap urlMapResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, urlMapResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -647,7 +776,7 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -656,7 +785,7 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -665,9 +794,35 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchRegionUrlMapRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchRegionUrlMapRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. /// @@ -685,7 +840,7 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string region, string urlMap, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string region, string urlMap, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchRegionUrlMapRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -711,7 +866,7 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, string urlMap, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string region, string urlMap, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchRegionUrlMapRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -737,7 +892,7 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, string urlMap, UrlMap urlMapResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string region, string urlMap, UrlMap urlMapResource, st::CancellationToken cancellationToken) => PatchAsync(project, region, urlMap, urlMapResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -746,7 +901,7 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(UpdateRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(UpdateRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -755,7 +910,7 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(UpdateRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -764,9 +919,35 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateRegionUrlMapRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(UpdateRegionUrlMapRequest request, st::CancellationToken cancellationToken) => UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Update. + public virtual lro::OperationsClient UpdateOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Update. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceUpdate(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Update + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceUpdateAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + /// /// Updates the specified UrlMap resource with the data included in the request. /// @@ -784,7 +965,7 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(string project, string region, string urlMap, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(string project, string region, string urlMap, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => Update(new UpdateRegionUrlMapRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -810,7 +991,7 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string region, string urlMap, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(string project, string region, string urlMap, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => UpdateAsync(new UpdateRegionUrlMapRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -836,7 +1017,7 @@ internal static RegionUrlMapsClient Create(grpccore::CallInvoker callInvoker, Re /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string region, string urlMap, UrlMap urlMapResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(string project, string region, string urlMap, UrlMap urlMapResource, st::CancellationToken cancellationToken) => UpdateAsync(project, region, urlMap, urlMapResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -969,6 +1150,10 @@ public RegionUrlMapsClientImpl(RegionUrlMaps.RegionUrlMapsClient grpcClient, Reg GrpcClient = grpcClient; RegionUrlMapsSettings effectiveSettings = settings ?? RegionUrlMapsSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.PatchOperationsSettings); + UpdateOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.UpdateOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("region", request => request.Region).WithGoogleRequestParam("url_map", request => request.UrlMap); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -1028,16 +1213,22 @@ public RegionUrlMapsClientImpl(RegionUrlMaps.RegionUrlMapsClient grpcClient, Reg partial void Modify_ValidateRegionUrlMapRequest(ref ValidateRegionUrlMapRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified UrlMap resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionUrlMapRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1046,10 +1237,13 @@ public override Operation Delete(DeleteRegionUrlMapRequest request, gaxgrpc::Cal /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRegionUrlMapRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1076,16 +1270,22 @@ public override UrlMap Get(GetRegionUrlMapRequest request, gaxgrpc::CallSettings return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a UrlMap resource in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionUrlMapRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1094,10 +1294,13 @@ public override Operation Insert(InsertRegionUrlMapRequest request, gaxgrpc::Cal /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRegionUrlMapRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1124,16 +1327,22 @@ public override Operation Insert(InsertRegionUrlMapRequest request, gaxgrpc::Cal return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchRegionUrlMapRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1142,22 +1351,31 @@ public override Operation Patch(PatchRegionUrlMapRequest request, gaxgrpc::CallS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchRegionUrlMapRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } + /// The long-running operations client for Update. + public override lro::OperationsClient UpdateOperationsClient { get; } + /// /// Updates the specified UrlMap resource with the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Update(UpdateRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Update(UpdateRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateRegionUrlMapRequest(ref request, ref callSettings); - return _callUpdate.Sync(request, callSettings); + Operation response = _callUpdate.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } /// @@ -1166,10 +1384,13 @@ public override Operation Update(UpdateRegionUrlMapRequest request, gaxgrpc::Cal /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task UpdateAsync(UpdateRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> UpdateAsync(UpdateRegionUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateRegionUrlMapRequest(ref request, ref callSettings); - return _callUpdate.Async(request, callSettings); + Operation response = await _callUpdate.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } /// @@ -1214,4 +1435,18 @@ public partial class UrlMapList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class RegionUrlMaps + { + public partial class RegionUrlMapsClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ReservationsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ReservationsClient.g.cs index 8bc3b6c2c65e..1625b430f78f 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ReservationsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ReservationsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -46,11 +47,14 @@ private ReservationsSettings(ReservationsSettings existing) : base(existing) gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; GetIamPolicySettings = existing.GetIamPolicySettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; ResizeSettings = existing.ResizeSettings; + ResizeOperationsSettings = existing.ResizeOperationsSettings.Clone(); SetIamPolicySettings = existing.SetIamPolicySettings; TestIamPermissionsSettings = existing.TestIamPermissionsSettings; OnCopy(existing); @@ -82,6 +86,24 @@ private ReservationsSettings(ReservationsSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ReservationsClient.Delete and + /// ReservationsClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to ReservationsClient.Get /// and ReservationsClient.GetAsync. @@ -118,6 +140,24 @@ private ReservationsSettings(ReservationsSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ReservationsClient.Insert and + /// ReservationsClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to ReservationsClient.List /// and ReservationsClient.ListAsync. @@ -142,6 +182,24 @@ private ReservationsSettings(ReservationsSettings existing) : base(existing) /// public gaxgrpc::CallSettings ResizeSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ReservationsClient.Resize and + /// ReservationsClient.ResizeAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings ResizeOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// ReservationsClient.SetIamPolicy and ReservationsClient.SetIamPolicyAsync. @@ -404,7 +462,7 @@ internal static ReservationsClient Create(grpccore::CallInvoker callInvoker, Res /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteReservationRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteReservationRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -413,7 +471,7 @@ internal static ReservationsClient Create(grpccore::CallInvoker callInvoker, Res /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteReservationRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteReservationRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -422,9 +480,35 @@ internal static ReservationsClient Create(grpccore::CallInvoker callInvoker, Res /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteReservationRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteReservationRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified reservation. /// @@ -439,7 +523,7 @@ internal static ReservationsClient Create(grpccore::CallInvoker callInvoker, Res /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string zone, string reservation, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string zone, string reservation, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteReservationRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -461,7 +545,7 @@ internal static ReservationsClient Create(grpccore::CallInvoker callInvoker, Res /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string zone, string reservation, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string zone, string reservation, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteReservationRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -483,7 +567,7 @@ internal static ReservationsClient Create(grpccore::CallInvoker callInvoker, Res /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string zone, string reservation, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string zone, string reservation, st::CancellationToken cancellationToken) => DeleteAsync(project, zone, reservation, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -668,7 +752,7 @@ internal static ReservationsClient Create(grpccore::CallInvoker callInvoker, Res /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertReservationRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertReservationRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -677,7 +761,7 @@ internal static ReservationsClient Create(grpccore::CallInvoker callInvoker, Res /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertReservationRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertReservationRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -686,9 +770,35 @@ internal static ReservationsClient Create(grpccore::CallInvoker callInvoker, Res /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertReservationRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertReservationRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a new reservation. For more information, read Reserving zonal resources. /// @@ -703,7 +813,7 @@ internal static ReservationsClient Create(grpccore::CallInvoker callInvoker, Res /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string zone, Reservation reservationResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string zone, Reservation reservationResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertReservationRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -725,7 +835,7 @@ internal static ReservationsClient Create(grpccore::CallInvoker callInvoker, Res /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string zone, Reservation reservationResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string zone, Reservation reservationResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertReservationRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -747,7 +857,7 @@ internal static ReservationsClient Create(grpccore::CallInvoker callInvoker, Res /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string zone, Reservation reservationResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string zone, Reservation reservationResource, st::CancellationToken cancellationToken) => InsertAsync(project, zone, reservationResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -830,7 +940,7 @@ internal static ReservationsClient Create(grpccore::CallInvoker callInvoker, Res /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Resize(ResizeReservationRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Resize(ResizeReservationRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -839,7 +949,7 @@ internal static ReservationsClient Create(grpccore::CallInvoker callInvoker, Res /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task ResizeAsync(ResizeReservationRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> ResizeAsync(ResizeReservationRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -848,9 +958,35 @@ internal static ReservationsClient Create(grpccore::CallInvoker callInvoker, Res /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task ResizeAsync(ResizeReservationRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> ResizeAsync(ResizeReservationRequest request, st::CancellationToken cancellationToken) => ResizeAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Resize. + public virtual lro::OperationsClient ResizeOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Resize. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceResize(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), ResizeOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Resize + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceResizeAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), ResizeOperationsClient, callSettings); + /// /// Resizes the reservation (applicable to standalone reservations only). For more information, read Modifying reservations. /// @@ -868,7 +1004,7 @@ internal static ReservationsClient Create(grpccore::CallInvoker callInvoker, Res /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Resize(string project, string zone, string reservation, ReservationsResizeRequest reservationsResizeRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Resize(string project, string zone, string reservation, ReservationsResizeRequest reservationsResizeRequestResource, gaxgrpc::CallSettings callSettings = null) => Resize(new ResizeReservationRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -894,7 +1030,7 @@ internal static ReservationsClient Create(grpccore::CallInvoker callInvoker, Res /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task ResizeAsync(string project, string zone, string reservation, ReservationsResizeRequest reservationsResizeRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> ResizeAsync(string project, string zone, string reservation, ReservationsResizeRequest reservationsResizeRequestResource, gaxgrpc::CallSettings callSettings = null) => ResizeAsync(new ResizeReservationRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -920,7 +1056,7 @@ internal static ReservationsClient Create(grpccore::CallInvoker callInvoker, Res /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task ResizeAsync(string project, string zone, string reservation, ReservationsResizeRequest reservationsResizeRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> ResizeAsync(string project, string zone, string reservation, ReservationsResizeRequest reservationsResizeRequestResource, st::CancellationToken cancellationToken) => ResizeAsync(project, zone, reservation, reservationsResizeRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1156,6 +1292,9 @@ public ReservationsClientImpl(Reservations.ReservationsClient grpcClient, Reserv GrpcClient = grpcClient; ReservationsSettings effectiveSettings = settings ?? ReservationsSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.InsertOperationsSettings); + ResizeOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.ResizeOperationsSettings); _callAggregatedList = clientHelper.BuildApiCall(grpcClient.AggregatedListAsync, grpcClient.AggregatedList, effectiveSettings.AggregatedListSettings).WithGoogleRequestParam("project", request => request.Project); Modify_ApiCall(ref _callAggregatedList); Modify_AggregatedListApiCall(ref _callAggregatedList); @@ -1255,16 +1394,22 @@ public ReservationsClientImpl(Reservations.ReservationsClient grpcClient, Reserv return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified reservation. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteReservationRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteReservationRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteReservationRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1273,10 +1418,13 @@ public override Operation Delete(DeleteReservationRequest request, gaxgrpc::Call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteReservationRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteReservationRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteReservationRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1327,16 +1475,22 @@ public override Policy GetIamPolicy(GetIamPolicyReservationRequest request, gaxg return _callGetIamPolicy.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a new reservation. For more information, read Reserving zonal resources. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertReservationRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertReservationRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertReservationRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1345,10 +1499,13 @@ public override Operation Insert(InsertReservationRequest request, gaxgrpc::Call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertReservationRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertReservationRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertReservationRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1375,16 +1532,22 @@ public override Operation Insert(InsertReservationRequest request, gaxgrpc::Call return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Resize. + public override lro::OperationsClient ResizeOperationsClient { get; } + /// /// Resizes the reservation (applicable to standalone reservations only). For more information, read Modifying reservations. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Resize(ResizeReservationRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Resize(ResizeReservationRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ResizeReservationRequest(ref request, ref callSettings); - return _callResize.Sync(request, callSettings); + Operation response = _callResize.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), ResizeOperationsClient); } /// @@ -1393,10 +1556,13 @@ public override Operation Resize(ResizeReservationRequest request, gaxgrpc::Call /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task ResizeAsync(ResizeReservationRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> ResizeAsync(ResizeReservationRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ResizeReservationRequest(ref request, ref callSettings); - return _callResize.Async(request, callSettings); + Operation response = await _callResize.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), ResizeOperationsClient); } /// @@ -1483,4 +1649,18 @@ public partial class ReservationList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class Reservations + { + public partial class ReservationsClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to ZoneOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForZoneOperations() => + ZoneOperations.ZoneOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ResourcePoliciesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ResourcePoliciesClient.g.cs index 958d72d99ac6..c4adebba0ba7 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ResourcePoliciesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ResourcePoliciesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -46,9 +47,11 @@ private ResourcePoliciesSettings(ResourcePoliciesSettings existing) : base(exist gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; GetIamPolicySettings = existing.GetIamPolicySettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; SetIamPolicySettings = existing.SetIamPolicySettings; TestIamPermissionsSettings = existing.TestIamPermissionsSettings; @@ -81,6 +84,24 @@ private ResourcePoliciesSettings(ResourcePoliciesSettings existing) : base(exist /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ResourcePoliciesClient.Delete and + /// ResourcePoliciesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to ResourcePoliciesClient.Get /// and ResourcePoliciesClient.GetAsync. @@ -117,6 +138,24 @@ private ResourcePoliciesSettings(ResourcePoliciesSettings existing) : base(exist /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to ResourcePoliciesClient.Insert and + /// ResourcePoliciesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to ResourcePoliciesClient.List /// and ResourcePoliciesClient.ListAsync. @@ -392,7 +431,7 @@ internal static ResourcePoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteResourcePolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteResourcePolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -401,7 +440,7 @@ internal static ResourcePoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteResourcePolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteResourcePolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -410,9 +449,35 @@ internal static ResourcePoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteResourcePolicyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteResourcePolicyRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified resource policy. /// @@ -427,7 +492,7 @@ internal static ResourcePoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string resourcePolicy, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string resourcePolicy, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteResourcePolicyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -449,7 +514,7 @@ internal static ResourcePoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string resourcePolicy, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string resourcePolicy, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteResourcePolicyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -471,7 +536,7 @@ internal static ResourcePoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string resourcePolicy, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string resourcePolicy, st::CancellationToken cancellationToken) => DeleteAsync(project, region, resourcePolicy, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -656,7 +721,7 @@ internal static ResourcePoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertResourcePolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertResourcePolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -665,7 +730,7 @@ internal static ResourcePoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertResourcePolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertResourcePolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -674,9 +739,35 @@ internal static ResourcePoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertResourcePolicyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertResourcePolicyRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a new resource policy. /// @@ -691,7 +782,7 @@ internal static ResourcePoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, ResourcePolicy resourcePolicyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, ResourcePolicy resourcePolicyResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertResourcePolicyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -713,7 +804,7 @@ internal static ResourcePoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, ResourcePolicy resourcePolicyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, ResourcePolicy resourcePolicyResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertResourcePolicyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -735,7 +826,7 @@ internal static ResourcePoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, ResourcePolicy resourcePolicyResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, ResourcePolicy resourcePolicyResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, resourcePolicyResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1043,6 +1134,8 @@ public ResourcePoliciesClientImpl(ResourcePolicies.ResourcePoliciesClient grpcCl GrpcClient = grpcClient; ResourcePoliciesSettings effectiveSettings = settings ?? ResourcePoliciesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); _callAggregatedList = clientHelper.BuildApiCall(grpcClient.AggregatedListAsync, grpcClient.AggregatedList, effectiveSettings.AggregatedListSettings).WithGoogleRequestParam("project", request => request.Project); Modify_ApiCall(ref _callAggregatedList); Modify_AggregatedListApiCall(ref _callAggregatedList); @@ -1135,16 +1228,22 @@ public ResourcePoliciesClientImpl(ResourcePolicies.ResourcePoliciesClient grpcCl return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified resource policy. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteResourcePolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteResourcePolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteResourcePolicyRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1153,10 +1252,13 @@ public override Operation Delete(DeleteResourcePolicyRequest request, gaxgrpc::C /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteResourcePolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteResourcePolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteResourcePolicyRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1207,16 +1309,22 @@ public override Policy GetIamPolicy(GetIamPolicyResourcePolicyRequest request, g return _callGetIamPolicy.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a new resource policy. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertResourcePolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertResourcePolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertResourcePolicyRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1225,10 +1333,13 @@ public override Operation Insert(InsertResourcePolicyRequest request, gaxgrpc::C /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertResourcePolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertResourcePolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertResourcePolicyRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1340,4 +1451,18 @@ public partial class ResourcePolicyList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class ResourcePolicies + { + public partial class ResourcePoliciesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RoutersClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RoutersClient.g.cs index e0a40f3b8534..7e61d9f78dbb 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RoutersClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RoutersClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -46,14 +47,18 @@ private RoutersSettings(RoutersSettings existing) : base(existing) gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; GetNatMappingInfoSettings = existing.GetNatMappingInfoSettings; GetRouterStatusSettings = existing.GetRouterStatusSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); PreviewSettings = existing.PreviewSettings; UpdateSettings = existing.UpdateSettings; + UpdateOperationsSettings = existing.UpdateOperationsSettings.Clone(); OnCopy(existing); } @@ -83,6 +88,24 @@ private RoutersSettings(RoutersSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RoutersClient.Delete and RoutersClient.DeleteAsync + /// . + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to RoutersClient.Get and /// RoutersClient.GetAsync. @@ -131,6 +154,24 @@ private RoutersSettings(RoutersSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RoutersClient.Insert and RoutersClient.InsertAsync + /// . + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to RoutersClient.List and /// RoutersClient.ListAsync. @@ -155,6 +196,23 @@ private RoutersSettings(RoutersSettings existing) : base(existing) /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RoutersClient.Patch and RoutersClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to RoutersClient.Preview /// and RoutersClient.PreviewAsync. @@ -179,6 +237,24 @@ private RoutersSettings(RoutersSettings existing) : base(existing) /// public gaxgrpc::CallSettings UpdateSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RoutersClient.Update and RoutersClient.UpdateAsync + /// . + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings UpdateOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public RoutersSettings Clone() => new RoutersSettings(this); @@ -416,7 +492,7 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteRouterRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteRouterRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -425,7 +501,7 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRouterRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteRouterRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -434,9 +510,35 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRouterRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteRouterRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified Router resource. /// @@ -451,7 +553,7 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string router, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string router, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteRouterRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -473,7 +575,7 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string router, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string router, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteRouterRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -495,7 +597,7 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string router, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string router, st::CancellationToken cancellationToken) => DeleteAsync(project, region, router, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -762,7 +864,7 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertRouterRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertRouterRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -771,7 +873,7 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRouterRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertRouterRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -780,9 +882,35 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRouterRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertRouterRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a Router resource in the specified project and region using the data included in the request. /// @@ -797,7 +925,7 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, Router routerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, Router routerResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertRouterRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -819,7 +947,7 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, Router routerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, Router routerResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertRouterRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -841,7 +969,7 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, Router routerResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, Router routerResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, routerResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -924,7 +1052,7 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchRouterRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchRouterRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -933,7 +1061,7 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchRouterRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchRouterRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -942,9 +1070,35 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchRouterRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchRouterRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. /// @@ -962,7 +1116,7 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string region, string router, Router routerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string region, string router, Router routerResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchRouterRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -988,7 +1142,7 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, string router, Router routerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string region, string router, Router routerResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchRouterRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1014,7 +1168,7 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, string router, Router routerResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string region, string router, Router routerResource, st::CancellationToken cancellationToken) => PatchAsync(project, region, router, routerResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1122,7 +1276,7 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(UpdateRouterRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(UpdateRouterRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1131,7 +1285,7 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateRouterRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(UpdateRouterRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1140,9 +1294,35 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateRouterRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(UpdateRouterRequest request, st::CancellationToken cancellationToken) => UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Update. + public virtual lro::OperationsClient UpdateOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Update. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceUpdate(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Update + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceUpdateAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + /// /// Updates the specified Router resource with the data included in the request. This method conforms to PUT semantics, which requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message payload. /// @@ -1160,7 +1340,7 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(string project, string region, string router, Router routerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(string project, string region, string router, Router routerResource, gaxgrpc::CallSettings callSettings = null) => Update(new UpdateRouterRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1186,7 +1366,7 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string region, string router, Router routerResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(string project, string region, string router, Router routerResource, gaxgrpc::CallSettings callSettings = null) => UpdateAsync(new UpdateRouterRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1212,7 +1392,7 @@ internal static RoutersClient Create(grpccore::CallInvoker callInvoker, RoutersS /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string region, string router, Router routerResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(string project, string region, string router, Router routerResource, st::CancellationToken cancellationToken) => UpdateAsync(project, region, router, routerResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -1252,6 +1432,10 @@ public RoutersClientImpl(Routers.RoutersClient grpcClient, RoutersSettings setti GrpcClient = grpcClient; RoutersSettings effectiveSettings = settings ?? RoutersSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.PatchOperationsSettings); + UpdateOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.UpdateOperationsSettings); _callAggregatedList = clientHelper.BuildApiCall(grpcClient.AggregatedListAsync, grpcClient.AggregatedList, effectiveSettings.AggregatedListSettings).WithGoogleRequestParam("project", request => request.Project); Modify_ApiCall(ref _callAggregatedList); Modify_AggregatedListApiCall(ref _callAggregatedList); @@ -1358,16 +1542,22 @@ public RoutersClientImpl(Routers.RoutersClient grpcClient, RoutersSettings setti return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified Router resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteRouterRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteRouterRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRouterRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1376,10 +1566,13 @@ public override Operation Delete(DeleteRouterRequest request, gaxgrpc::CallSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteRouterRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteRouterRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRouterRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1454,16 +1647,22 @@ public override RouterStatusResponse GetRouterStatus(GetRouterStatusRouterReques return _callGetRouterStatus.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a Router resource in the specified project and region using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertRouterRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertRouterRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRouterRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1472,10 +1671,13 @@ public override Operation Insert(InsertRouterRequest request, gaxgrpc::CallSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertRouterRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertRouterRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRouterRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1502,16 +1704,22 @@ public override Operation Insert(InsertRouterRequest request, gaxgrpc::CallSetti return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchRouterRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchRouterRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchRouterRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1520,10 +1728,13 @@ public override Operation Patch(PatchRouterRequest request, gaxgrpc::CallSetting /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchRouterRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchRouterRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchRouterRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1550,16 +1761,22 @@ public override RoutersPreviewResponse Preview(PreviewRouterRequest request, gax return _callPreview.Async(request, callSettings); } + /// The long-running operations client for Update. + public override lro::OperationsClient UpdateOperationsClient { get; } + /// /// Updates the specified Router resource with the data included in the request. This method conforms to PUT semantics, which requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message payload. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Update(UpdateRouterRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Update(UpdateRouterRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateRouterRequest(ref request, ref callSettings); - return _callUpdate.Sync(request, callSettings); + Operation response = _callUpdate.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } /// @@ -1568,10 +1785,13 @@ public override Operation Update(UpdateRouterRequest request, gaxgrpc::CallSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task UpdateAsync(UpdateRouterRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> UpdateAsync(UpdateRouterRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateRouterRequest(ref request, ref callSettings); - return _callUpdate.Async(request, callSettings); + Operation response = await _callUpdate.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } } @@ -1628,4 +1848,18 @@ public partial class RouterList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class Routers + { + public partial class RoutersClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RoutesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RoutesClient.g.cs index 06ea57ab8c64..bd61a29a2c97 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RoutesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/RoutesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,8 +46,10 @@ private RoutesSettings(RoutesSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; OnCopy(existing); } @@ -65,6 +68,23 @@ private RoutesSettings(RoutesSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RoutesClient.Delete and RoutesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to RoutesClient.Get and /// RoutesClient.GetAsync. @@ -89,6 +109,23 @@ private RoutesSettings(RoutesSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to RoutesClient.Insert and RoutesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to RoutesClient.List and /// RoutesClient.ListAsync. @@ -268,7 +305,7 @@ internal static RoutesClient Create(grpccore::CallInvoker callInvoker, RoutesSet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteRouteRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteRouteRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -277,7 +314,7 @@ internal static RoutesClient Create(grpccore::CallInvoker callInvoker, RoutesSet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRouteRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteRouteRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -286,9 +323,35 @@ internal static RoutesClient Create(grpccore::CallInvoker callInvoker, RoutesSet /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteRouteRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteRouteRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified Route resource. /// @@ -300,7 +363,7 @@ internal static RoutesClient Create(grpccore::CallInvoker callInvoker, RoutesSet /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string route, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string route, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteRouteRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -318,7 +381,7 @@ internal static RoutesClient Create(grpccore::CallInvoker callInvoker, RoutesSet /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string route, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string route, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteRouteRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -336,7 +399,7 @@ internal static RoutesClient Create(grpccore::CallInvoker callInvoker, RoutesSet /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string route, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string route, st::CancellationToken cancellationToken) => DeleteAsync(project, route, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -422,7 +485,7 @@ internal static RoutesClient Create(grpccore::CallInvoker callInvoker, RoutesSet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertRouteRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertRouteRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -431,7 +494,7 @@ internal static RoutesClient Create(grpccore::CallInvoker callInvoker, RoutesSet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRouteRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertRouteRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -440,9 +503,35 @@ internal static RoutesClient Create(grpccore::CallInvoker callInvoker, RoutesSet /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertRouteRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertRouteRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a Route resource in the specified project using the data included in the request. /// @@ -454,7 +543,7 @@ internal static RoutesClient Create(grpccore::CallInvoker callInvoker, RoutesSet /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, Route routeResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, Route routeResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertRouteRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -472,7 +561,7 @@ internal static RoutesClient Create(grpccore::CallInvoker callInvoker, RoutesSet /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, Route routeResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, Route routeResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertRouteRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -490,7 +579,7 @@ internal static RoutesClient Create(grpccore::CallInvoker callInvoker, RoutesSet /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, Route routeResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, Route routeResource, st::CancellationToken cancellationToken) => InsertAsync(project, routeResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -584,6 +673,8 @@ public RoutesClientImpl(Routes.RoutesClient grpcClient, RoutesSettings settings) GrpcClient = grpcClient; RoutesSettings effectiveSettings = settings ?? RoutesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("route", request => request.Route); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -622,16 +713,22 @@ public RoutesClientImpl(Routes.RoutesClient grpcClient, RoutesSettings settings) partial void Modify_ListRoutesRequest(ref ListRoutesRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified Route resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteRouteRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteRouteRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRouteRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -640,10 +737,13 @@ public override Operation Delete(DeleteRouteRequest request, gaxgrpc::CallSettin /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteRouteRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteRouteRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteRouteRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -670,16 +770,22 @@ public override Route Get(GetRouteRequest request, gaxgrpc::CallSettings callSet return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a Route resource in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertRouteRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertRouteRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRouteRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -688,10 +794,13 @@ public override Operation Insert(InsertRouteRequest request, gaxgrpc::CallSettin /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertRouteRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertRouteRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertRouteRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -736,4 +845,18 @@ public partial class RouteList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class Routes + { + public partial class RoutesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/SecurityPoliciesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/SecurityPoliciesClient.g.cs index 3e6ca2b031bc..8f1fbd64faa3 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/SecurityPoliciesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/SecurityPoliciesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,15 +46,21 @@ private SecurityPoliciesSettings(SecurityPoliciesSettings existing) : base(exist { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AddRuleSettings = existing.AddRuleSettings; + AddRuleOperationsSettings = existing.AddRuleOperationsSettings.Clone(); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; GetRuleSettings = existing.GetRuleSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; ListPreconfiguredExpressionSetsSettings = existing.ListPreconfiguredExpressionSetsSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); PatchRuleSettings = existing.PatchRuleSettings; + PatchRuleOperationsSettings = existing.PatchRuleOperationsSettings.Clone(); RemoveRuleSettings = existing.RemoveRuleSettings; + RemoveRuleOperationsSettings = existing.RemoveRuleOperationsSettings.Clone(); OnCopy(existing); } @@ -71,6 +78,24 @@ private SecurityPoliciesSettings(SecurityPoliciesSettings existing) : base(exist /// public gaxgrpc::CallSettings AddRuleSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to SecurityPoliciesClient.AddRule and + /// SecurityPoliciesClient.AddRuleAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings AddRuleOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// SecurityPoliciesClient.Delete and SecurityPoliciesClient.DeleteAsync. @@ -83,6 +108,24 @@ private SecurityPoliciesSettings(SecurityPoliciesSettings existing) : base(exist /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to SecurityPoliciesClient.Delete and + /// SecurityPoliciesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to SecurityPoliciesClient.Get /// and SecurityPoliciesClient.GetAsync. @@ -119,6 +162,24 @@ private SecurityPoliciesSettings(SecurityPoliciesSettings existing) : base(exist /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to SecurityPoliciesClient.Insert and + /// SecurityPoliciesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to SecurityPoliciesClient.List /// and SecurityPoliciesClient.ListAsync. @@ -156,6 +217,24 @@ private SecurityPoliciesSettings(SecurityPoliciesSettings existing) : base(exist /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to SecurityPoliciesClient.Patch and + /// SecurityPoliciesClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// SecurityPoliciesClient.PatchRule and SecurityPoliciesClient.PatchRuleAsync. @@ -168,6 +247,24 @@ private SecurityPoliciesSettings(SecurityPoliciesSettings existing) : base(exist /// public gaxgrpc::CallSettings PatchRuleSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to SecurityPoliciesClient.PatchRule and + /// SecurityPoliciesClient.PatchRuleAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchRuleOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// SecurityPoliciesClient.RemoveRule and SecurityPoliciesClient.RemoveRuleAsync. @@ -180,6 +277,24 @@ private SecurityPoliciesSettings(SecurityPoliciesSettings existing) : base(exist /// public gaxgrpc::CallSettings RemoveRuleSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to SecurityPoliciesClient.RemoveRule and + /// SecurityPoliciesClient.RemoveRuleAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings RemoveRuleOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public SecurityPoliciesSettings Clone() => new SecurityPoliciesSettings(this); @@ -349,7 +464,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddRule(AddRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddRule(AddRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -358,7 +473,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddRuleAsync(AddRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddRuleAsync(AddRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -367,9 +482,35 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddRuleAsync(AddRuleSecurityPolicyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddRuleAsync(AddRuleSecurityPolicyRequest request, st::CancellationToken cancellationToken) => AddRuleAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for AddRule. + public virtual lro::OperationsClient AddRuleOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of AddRule. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceAddRule(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddRuleOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// AddRule. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceAddRuleAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddRuleOperationsClient, callSettings); + /// /// Inserts a rule into a security policy. /// @@ -384,7 +525,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddRule(string project, string securityPolicy, SecurityPolicyRule securityPolicyRuleResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddRule(string project, string securityPolicy, SecurityPolicyRule securityPolicyRuleResource, gaxgrpc::CallSettings callSettings = null) => AddRule(new AddRuleSecurityPolicyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -406,7 +547,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddRuleAsync(string project, string securityPolicy, SecurityPolicyRule securityPolicyRuleResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddRuleAsync(string project, string securityPolicy, SecurityPolicyRule securityPolicyRuleResource, gaxgrpc::CallSettings callSettings = null) => AddRuleAsync(new AddRuleSecurityPolicyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -428,7 +569,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddRuleAsync(string project, string securityPolicy, SecurityPolicyRule securityPolicyRuleResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddRuleAsync(string project, string securityPolicy, SecurityPolicyRule securityPolicyRuleResource, st::CancellationToken cancellationToken) => AddRuleAsync(project, securityPolicy, securityPolicyRuleResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -437,7 +578,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -446,7 +587,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -455,9 +596,35 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteSecurityPolicyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteSecurityPolicyRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified policy. /// @@ -469,7 +636,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string securityPolicy, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string securityPolicy, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteSecurityPolicyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -487,7 +654,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string securityPolicy, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string securityPolicy, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteSecurityPolicyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -505,7 +672,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string securityPolicy, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string securityPolicy, st::CancellationToken cancellationToken) => DeleteAsync(project, securityPolicy, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -668,7 +835,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -677,7 +844,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -686,9 +853,35 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertSecurityPolicyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertSecurityPolicyRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a new policy in the specified project using the data included in the request. /// @@ -700,7 +893,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, SecurityPolicy securityPolicyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, SecurityPolicy securityPolicyResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertSecurityPolicyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -718,7 +911,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, SecurityPolicy securityPolicyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, SecurityPolicy securityPolicyResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertSecurityPolicyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -736,7 +929,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, SecurityPolicy securityPolicyResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, SecurityPolicy securityPolicyResource, st::CancellationToken cancellationToken) => InsertAsync(project, securityPolicyResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -877,7 +1070,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -886,7 +1079,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -895,9 +1088,35 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchSecurityPolicyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchSecurityPolicyRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Patches the specified policy with the data included in the request. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead. /// @@ -912,7 +1131,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string securityPolicy, SecurityPolicy securityPolicyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string securityPolicy, SecurityPolicy securityPolicyResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchSecurityPolicyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -934,7 +1153,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string securityPolicy, SecurityPolicy securityPolicyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string securityPolicy, SecurityPolicy securityPolicyResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchSecurityPolicyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -956,7 +1175,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string securityPolicy, SecurityPolicy securityPolicyResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string securityPolicy, SecurityPolicy securityPolicyResource, st::CancellationToken cancellationToken) => PatchAsync(project, securityPolicy, securityPolicyResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -965,7 +1184,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation PatchRule(PatchRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation PatchRule(PatchRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -974,7 +1193,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchRuleAsync(PatchRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchRuleAsync(PatchRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -983,9 +1202,35 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchRuleAsync(PatchRuleSecurityPolicyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchRuleAsync(PatchRuleSecurityPolicyRequest request, st::CancellationToken cancellationToken) => PatchRuleAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for PatchRule. + public virtual lro::OperationsClient PatchRuleOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of PatchRule. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatchRule(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchRuleOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// PatchRule. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchRuleAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchRuleOperationsClient, callSettings); + /// /// Patches a rule at the specified priority. /// @@ -1000,7 +1245,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation PatchRule(string project, string securityPolicy, SecurityPolicyRule securityPolicyRuleResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation PatchRule(string project, string securityPolicy, SecurityPolicyRule securityPolicyRuleResource, gaxgrpc::CallSettings callSettings = null) => PatchRule(new PatchRuleSecurityPolicyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1022,7 +1267,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchRuleAsync(string project, string securityPolicy, SecurityPolicyRule securityPolicyRuleResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchRuleAsync(string project, string securityPolicy, SecurityPolicyRule securityPolicyRuleResource, gaxgrpc::CallSettings callSettings = null) => PatchRuleAsync(new PatchRuleSecurityPolicyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1044,7 +1289,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchRuleAsync(string project, string securityPolicy, SecurityPolicyRule securityPolicyRuleResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchRuleAsync(string project, string securityPolicy, SecurityPolicyRule securityPolicyRuleResource, st::CancellationToken cancellationToken) => PatchRuleAsync(project, securityPolicy, securityPolicyRuleResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1053,7 +1298,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RemoveRule(RemoveRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RemoveRule(RemoveRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1062,7 +1307,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RemoveRuleAsync(RemoveRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RemoveRuleAsync(RemoveRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1071,9 +1316,35 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RemoveRuleAsync(RemoveRuleSecurityPolicyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> RemoveRuleAsync(RemoveRuleSecurityPolicyRequest request, st::CancellationToken cancellationToken) => RemoveRuleAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for RemoveRule. + public virtual lro::OperationsClient RemoveRuleOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of RemoveRule. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceRemoveRule(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RemoveRuleOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// RemoveRule. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceRemoveRuleAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RemoveRuleOperationsClient, callSettings); + /// /// Deletes a rule at the specified priority. /// @@ -1085,7 +1356,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RemoveRule(string project, string securityPolicy, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RemoveRule(string project, string securityPolicy, gaxgrpc::CallSettings callSettings = null) => RemoveRule(new RemoveRuleSecurityPolicyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1103,7 +1374,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RemoveRuleAsync(string project, string securityPolicy, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RemoveRuleAsync(string project, string securityPolicy, gaxgrpc::CallSettings callSettings = null) => RemoveRuleAsync(new RemoveRuleSecurityPolicyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1121,7 +1392,7 @@ internal static SecurityPoliciesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RemoveRuleAsync(string project, string securityPolicy, st::CancellationToken cancellationToken) => + public virtual stt::Task> RemoveRuleAsync(string project, string securityPolicy, st::CancellationToken cancellationToken) => RemoveRuleAsync(project, securityPolicy, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -1161,6 +1432,12 @@ public SecurityPoliciesClientImpl(SecurityPolicies.SecurityPoliciesClient grpcCl GrpcClient = grpcClient; SecurityPoliciesSettings effectiveSettings = settings ?? SecurityPoliciesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + AddRuleOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.AddRuleOperationsSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.PatchOperationsSettings); + PatchRuleOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.PatchRuleOperationsSettings); + RemoveRuleOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.RemoveRuleOperationsSettings); _callAddRule = clientHelper.BuildApiCall(grpcClient.AddRuleAsync, grpcClient.AddRule, effectiveSettings.AddRuleSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("security_policy", request => request.SecurityPolicy); Modify_ApiCall(ref _callAddRule); Modify_AddRuleApiCall(ref _callAddRule); @@ -1241,16 +1518,22 @@ public SecurityPoliciesClientImpl(SecurityPolicies.SecurityPoliciesClient grpcCl partial void Modify_RemoveRuleSecurityPolicyRequest(ref RemoveRuleSecurityPolicyRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for AddRule. + public override lro::OperationsClient AddRuleOperationsClient { get; } + /// /// Inserts a rule into a security policy. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation AddRule(AddRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation AddRule(AddRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddRuleSecurityPolicyRequest(ref request, ref callSettings); - return _callAddRule.Sync(request, callSettings); + Operation response = _callAddRule.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddRuleOperationsClient); } /// @@ -1259,22 +1542,31 @@ public override Operation AddRule(AddRuleSecurityPolicyRequest request, gaxgrpc: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task AddRuleAsync(AddRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> AddRuleAsync(AddRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddRuleSecurityPolicyRequest(ref request, ref callSettings); - return _callAddRule.Async(request, callSettings); + Operation response = await _callAddRule.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddRuleOperationsClient); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified policy. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteSecurityPolicyRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1283,10 +1575,13 @@ public override Operation Delete(DeleteSecurityPolicyRequest request, gaxgrpc::C /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteSecurityPolicyRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1337,16 +1632,22 @@ public override SecurityPolicyRule GetRule(GetRuleSecurityPolicyRequest request, return _callGetRule.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a new policy in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertSecurityPolicyRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1355,10 +1656,13 @@ public override Operation Insert(InsertSecurityPolicyRequest request, gaxgrpc::C /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertSecurityPolicyRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1409,16 +1713,22 @@ public override SecurityPoliciesListPreconfiguredExpressionSetsResponse ListPrec return _callListPreconfiguredExpressionSets.Async(request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Patches the specified policy with the data included in the request. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchSecurityPolicyRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1427,22 +1737,31 @@ public override Operation Patch(PatchSecurityPolicyRequest request, gaxgrpc::Cal /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchSecurityPolicyRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } + /// The long-running operations client for PatchRule. + public override lro::OperationsClient PatchRuleOperationsClient { get; } + /// /// Patches a rule at the specified priority. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation PatchRule(PatchRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation PatchRule(PatchRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchRuleSecurityPolicyRequest(ref request, ref callSettings); - return _callPatchRule.Sync(request, callSettings); + Operation response = _callPatchRule.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchRuleOperationsClient); } /// @@ -1451,22 +1770,31 @@ public override Operation PatchRule(PatchRuleSecurityPolicyRequest request, gaxg /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchRuleAsync(PatchRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchRuleAsync(PatchRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchRuleSecurityPolicyRequest(ref request, ref callSettings); - return _callPatchRule.Async(request, callSettings); + Operation response = await _callPatchRule.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchRuleOperationsClient); } + /// The long-running operations client for RemoveRule. + public override lro::OperationsClient RemoveRuleOperationsClient { get; } + /// /// Deletes a rule at the specified priority. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation RemoveRule(RemoveRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation RemoveRule(RemoveRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RemoveRuleSecurityPolicyRequest(ref request, ref callSettings); - return _callRemoveRule.Sync(request, callSettings); + Operation response = _callRemoveRule.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RemoveRuleOperationsClient); } /// @@ -1475,10 +1803,13 @@ public override Operation RemoveRule(RemoveRuleSecurityPolicyRequest request, ga /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task RemoveRuleAsync(RemoveRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> RemoveRuleAsync(RemoveRuleSecurityPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RemoveRuleSecurityPolicyRequest(ref request, ref callSettings); - return _callRemoveRule.Async(request, callSettings); + Operation response = await _callRemoveRule.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RemoveRuleOperationsClient); } } @@ -1499,4 +1830,18 @@ public partial class SecurityPolicyList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class SecurityPolicies + { + public partial class SecurityPoliciesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/SnapshotsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/SnapshotsClient.g.cs index 0ac09d381dd1..e256cb363a2f 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/SnapshotsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/SnapshotsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,11 +46,13 @@ private SnapshotsSettings(SnapshotsSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; GetIamPolicySettings = existing.GetIamPolicySettings; ListSettings = existing.ListSettings; SetIamPolicySettings = existing.SetIamPolicySettings; SetLabelsSettings = existing.SetLabelsSettings; + SetLabelsOperationsSettings = existing.SetLabelsOperationsSettings.Clone(); TestIamPermissionsSettings = existing.TestIamPermissionsSettings; OnCopy(existing); } @@ -68,6 +71,24 @@ private SnapshotsSettings(SnapshotsSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to SnapshotsClient.Delete and + /// SnapshotsClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to SnapshotsClient.Get and /// SnapshotsClient.GetAsync. @@ -128,6 +149,24 @@ private SnapshotsSettings(SnapshotsSettings existing) : base(existing) /// public gaxgrpc::CallSettings SetLabelsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to SnapshotsClient.SetLabels and + /// SnapshotsClient.SetLabelsAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetLabelsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// SnapshotsClient.TestIamPermissions and SnapshotsClient.TestIamPermissionsAsync. @@ -310,7 +349,7 @@ internal static SnapshotsClient Create(grpccore::CallInvoker callInvoker, Snapsh /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteSnapshotRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteSnapshotRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -321,7 +360,7 @@ internal static SnapshotsClient Create(grpccore::CallInvoker callInvoker, Snapsh /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteSnapshotRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteSnapshotRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -332,9 +371,35 @@ internal static SnapshotsClient Create(grpccore::CallInvoker callInvoker, Snapsh /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteSnapshotRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteSnapshotRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. /// @@ -348,7 +413,7 @@ internal static SnapshotsClient Create(grpccore::CallInvoker callInvoker, Snapsh /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string snapshot, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string snapshot, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteSnapshotRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -368,7 +433,7 @@ internal static SnapshotsClient Create(grpccore::CallInvoker callInvoker, Snapsh /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string snapshot, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string snapshot, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteSnapshotRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -388,7 +453,7 @@ internal static SnapshotsClient Create(grpccore::CallInvoker callInvoker, Snapsh /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string snapshot, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string snapshot, st::CancellationToken cancellationToken) => DeleteAsync(project, snapshot, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -705,7 +770,7 @@ internal static SnapshotsClient Create(grpccore::CallInvoker callInvoker, Snapsh /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetLabels(SetLabelsSnapshotRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetLabels(SetLabelsSnapshotRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -714,7 +779,7 @@ internal static SnapshotsClient Create(grpccore::CallInvoker callInvoker, Snapsh /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(SetLabelsSnapshotRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetLabelsAsync(SetLabelsSnapshotRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -723,9 +788,35 @@ internal static SnapshotsClient Create(grpccore::CallInvoker callInvoker, Snapsh /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(SetLabelsSnapshotRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetLabelsAsync(SetLabelsSnapshotRequest request, st::CancellationToken cancellationToken) => SetLabelsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetLabels. + public virtual lro::OperationsClient SetLabelsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetLabels. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetLabels(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetLabelsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetLabels. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetLabelsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetLabelsOperationsClient, callSettings); + /// /// Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation. /// @@ -740,7 +831,7 @@ internal static SnapshotsClient Create(grpccore::CallInvoker callInvoker, Snapsh /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetLabels(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetLabels(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetLabels(new SetLabelsSnapshotRequest { GlobalSetLabelsRequestResource = gax::GaxPreconditions.CheckNotNull(globalSetLabelsRequestResource, nameof(globalSetLabelsRequestResource)), @@ -762,7 +853,7 @@ internal static SnapshotsClient Create(grpccore::CallInvoker callInvoker, Snapsh /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetLabelsAsync(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetLabelsAsync(new SetLabelsSnapshotRequest { GlobalSetLabelsRequestResource = gax::GaxPreconditions.CheckNotNull(globalSetLabelsRequestResource, nameof(globalSetLabelsRequestResource)), @@ -784,7 +875,7 @@ internal static SnapshotsClient Create(grpccore::CallInvoker callInvoker, Snapsh /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetLabelsAsync(string project, string resource, GlobalSetLabelsRequest globalSetLabelsRequestResource, st::CancellationToken cancellationToken) => SetLabelsAsync(project, resource, globalSetLabelsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -906,6 +997,8 @@ public SnapshotsClientImpl(Snapshots.SnapshotsClient grpcClient, SnapshotsSettin GrpcClient = grpcClient; SnapshotsSettings effectiveSettings = settings ?? SnapshotsSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + SetLabelsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.SetLabelsOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("snapshot", request => request.Snapshot); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -965,6 +1058,9 @@ public SnapshotsClientImpl(Snapshots.SnapshotsClient grpcClient, SnapshotsSettin partial void Modify_TestIamPermissionsSnapshotRequest(ref TestIamPermissionsSnapshotRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. /// @@ -973,10 +1069,13 @@ public SnapshotsClientImpl(Snapshots.SnapshotsClient grpcClient, SnapshotsSettin /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteSnapshotRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteSnapshotRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteSnapshotRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -987,10 +1086,13 @@ public override Operation Delete(DeleteSnapshotRequest request, gaxgrpc::CallSet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteSnapshotRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteSnapshotRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteSnapshotRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1089,16 +1191,22 @@ public override Policy SetIamPolicy(SetIamPolicySnapshotRequest request, gaxgrpc return _callSetIamPolicy.Async(request, callSettings); } + /// The long-running operations client for SetLabels. + public override lro::OperationsClient SetLabelsOperationsClient { get; } + /// /// Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetLabels(SetLabelsSnapshotRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetLabels(SetLabelsSnapshotRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetLabelsSnapshotRequest(ref request, ref callSettings); - return _callSetLabels.Sync(request, callSettings); + Operation response = _callSetLabels.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetLabelsOperationsClient); } /// @@ -1107,10 +1215,13 @@ public override Operation SetLabels(SetLabelsSnapshotRequest request, gaxgrpc::C /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetLabelsAsync(SetLabelsSnapshotRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetLabelsAsync(SetLabelsSnapshotRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetLabelsSnapshotRequest(ref request, ref callSettings); - return _callSetLabels.Async(request, callSettings); + Operation response = await _callSetLabels.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetLabelsOperationsClient); } /// @@ -1155,4 +1266,18 @@ public partial class SnapshotList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class Snapshots + { + public partial class SnapshotsClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/SslCertificatesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/SslCertificatesClient.g.cs index 46434c84dc06..7e2b24aaea2c 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/SslCertificatesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/SslCertificatesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -46,8 +47,10 @@ private SslCertificatesSettings(SslCertificatesSettings existing) : base(existin gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; OnCopy(existing); } @@ -78,6 +81,24 @@ private SslCertificatesSettings(SslCertificatesSettings existing) : base(existin /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to SslCertificatesClient.Delete and + /// SslCertificatesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to SslCertificatesClient.Get /// and SslCertificatesClient.GetAsync. @@ -102,6 +123,24 @@ private SslCertificatesSettings(SslCertificatesSettings existing) : base(existin /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to SslCertificatesClient.Insert and + /// SslCertificatesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to SslCertificatesClient.List /// and SslCertificatesClient.ListAsync. @@ -353,7 +392,7 @@ internal static SslCertificatesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -362,7 +401,7 @@ internal static SslCertificatesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -371,9 +410,35 @@ internal static SslCertificatesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteSslCertificateRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteSslCertificateRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified SslCertificate resource. /// @@ -385,7 +450,7 @@ internal static SslCertificatesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string sslCertificate, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string sslCertificate, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteSslCertificateRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -403,7 +468,7 @@ internal static SslCertificatesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string sslCertificate, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string sslCertificate, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteSslCertificateRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -421,7 +486,7 @@ internal static SslCertificatesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string sslCertificate, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string sslCertificate, st::CancellationToken cancellationToken) => DeleteAsync(project, sslCertificate, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -507,7 +572,7 @@ internal static SslCertificatesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -516,7 +581,7 @@ internal static SslCertificatesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -525,9 +590,35 @@ internal static SslCertificatesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertSslCertificateRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertSslCertificateRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a SslCertificate resource in the specified project using the data included in the request. /// @@ -539,7 +630,7 @@ internal static SslCertificatesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, SslCertificate sslCertificateResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, SslCertificate sslCertificateResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertSslCertificateRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -557,7 +648,7 @@ internal static SslCertificatesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, SslCertificate sslCertificateResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, SslCertificate sslCertificateResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertSslCertificateRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -575,7 +666,7 @@ internal static SslCertificatesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, SslCertificate sslCertificateResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, SslCertificate sslCertificateResource, st::CancellationToken cancellationToken) => InsertAsync(project, sslCertificateResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -671,6 +762,8 @@ public SslCertificatesClientImpl(SslCertificates.SslCertificatesClient grpcClien GrpcClient = grpcClient; SslCertificatesSettings effectiveSettings = settings ?? SslCertificatesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); _callAggregatedList = clientHelper.BuildApiCall(grpcClient.AggregatedListAsync, grpcClient.AggregatedList, effectiveSettings.AggregatedListSettings).WithGoogleRequestParam("project", request => request.Project); Modify_ApiCall(ref _callAggregatedList); Modify_AggregatedListApiCall(ref _callAggregatedList); @@ -742,16 +835,22 @@ public SslCertificatesClientImpl(SslCertificates.SslCertificatesClient grpcClien return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified SslCertificate resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteSslCertificateRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -760,10 +859,13 @@ public override Operation Delete(DeleteSslCertificateRequest request, gaxgrpc::C /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteSslCertificateRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -790,16 +892,22 @@ public override SslCertificate Get(GetSslCertificateRequest request, gaxgrpc::Ca return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a SslCertificate resource in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertSslCertificateRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -808,10 +916,13 @@ public override Operation Insert(InsertSslCertificateRequest request, gaxgrpc::C /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertSslCertificateRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertSslCertificateRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -867,4 +978,18 @@ public partial class SslCertificateAggregatedList : gaxgrpc::IPageResponse GetEnumerator(); } + + public static partial class SslCertificates + { + public partial class SslCertificatesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/SslPoliciesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/SslPoliciesClient.g.cs index 391eb24382cc..e1ee8323e013 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/SslPoliciesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/SslPoliciesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,11 +46,14 @@ private SslPoliciesSettings(SslPoliciesSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; ListAvailableFeaturesSettings = existing.ListAvailableFeaturesSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); OnCopy(existing); } @@ -67,6 +71,24 @@ private SslPoliciesSettings(SslPoliciesSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to SslPoliciesClient.Delete and + /// SslPoliciesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to SslPoliciesClient.Get /// and SslPoliciesClient.GetAsync. @@ -91,6 +113,24 @@ private SslPoliciesSettings(SslPoliciesSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to SslPoliciesClient.Insert and + /// SslPoliciesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to SslPoliciesClient.List /// and SslPoliciesClient.ListAsync. @@ -127,6 +167,24 @@ private SslPoliciesSettings(SslPoliciesSettings existing) : base(existing) /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to SslPoliciesClient.Patch and + /// SslPoliciesClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public SslPoliciesSettings Clone() => new SslPoliciesSettings(this); @@ -295,7 +353,7 @@ internal static SslPoliciesClient Create(grpccore::CallInvoker callInvoker, SslP /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -304,7 +362,7 @@ internal static SslPoliciesClient Create(grpccore::CallInvoker callInvoker, SslP /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -313,9 +371,35 @@ internal static SslPoliciesClient Create(grpccore::CallInvoker callInvoker, SslP /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteSslPolicyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteSslPolicyRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources. /// @@ -327,7 +411,7 @@ internal static SslPoliciesClient Create(grpccore::CallInvoker callInvoker, SslP /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string sslPolicy, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string sslPolicy, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteSslPolicyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -345,7 +429,7 @@ internal static SslPoliciesClient Create(grpccore::CallInvoker callInvoker, SslP /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string sslPolicy, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string sslPolicy, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteSslPolicyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -363,7 +447,7 @@ internal static SslPoliciesClient Create(grpccore::CallInvoker callInvoker, SslP /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string sslPolicy, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string sslPolicy, st::CancellationToken cancellationToken) => DeleteAsync(project, sslPolicy, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -449,7 +533,7 @@ internal static SslPoliciesClient Create(grpccore::CallInvoker callInvoker, SslP /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -458,7 +542,7 @@ internal static SslPoliciesClient Create(grpccore::CallInvoker callInvoker, SslP /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -467,9 +551,35 @@ internal static SslPoliciesClient Create(grpccore::CallInvoker callInvoker, SslP /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertSslPolicyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertSslPolicyRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Returns the specified SSL policy resource. Gets a list of available SSL policies by making a list() request. /// @@ -481,7 +591,7 @@ internal static SslPoliciesClient Create(grpccore::CallInvoker callInvoker, SslP /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, SslPolicy sslPolicyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, SslPolicy sslPolicyResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertSslPolicyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -499,7 +609,7 @@ internal static SslPoliciesClient Create(grpccore::CallInvoker callInvoker, SslP /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, SslPolicy sslPolicyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, SslPolicy sslPolicyResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertSslPolicyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -517,7 +627,7 @@ internal static SslPoliciesClient Create(grpccore::CallInvoker callInvoker, SslP /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, SslPolicy sslPolicyResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, SslPolicy sslPolicyResource, st::CancellationToken cancellationToken) => InsertAsync(project, sslPolicyResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -658,7 +768,7 @@ internal static SslPoliciesClient Create(grpccore::CallInvoker callInvoker, SslP /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -667,7 +777,7 @@ internal static SslPoliciesClient Create(grpccore::CallInvoker callInvoker, SslP /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -676,9 +786,35 @@ internal static SslPoliciesClient Create(grpccore::CallInvoker callInvoker, SslP /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchSslPolicyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchSslPolicyRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Patches the specified SSL policy with the data included in the request. /// @@ -693,7 +829,7 @@ internal static SslPoliciesClient Create(grpccore::CallInvoker callInvoker, SslP /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string sslPolicy, SslPolicy sslPolicyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string sslPolicy, SslPolicy sslPolicyResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchSslPolicyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -715,7 +851,7 @@ internal static SslPoliciesClient Create(grpccore::CallInvoker callInvoker, SslP /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string sslPolicy, SslPolicy sslPolicyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string sslPolicy, SslPolicy sslPolicyResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchSslPolicyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -737,7 +873,7 @@ internal static SslPoliciesClient Create(grpccore::CallInvoker callInvoker, SslP /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string sslPolicy, SslPolicy sslPolicyResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string sslPolicy, SslPolicy sslPolicyResource, st::CancellationToken cancellationToken) => PatchAsync(project, sslPolicy, sslPolicyResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -769,6 +905,9 @@ public SslPoliciesClientImpl(SslPolicies.SslPoliciesClient grpcClient, SslPolici GrpcClient = grpcClient; SslPoliciesSettings effectiveSettings = settings ?? SslPoliciesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.PatchOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("ssl_policy", request => request.SslPolicy); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -821,16 +960,22 @@ public SslPoliciesClientImpl(SslPolicies.SslPoliciesClient grpcClient, SslPolici partial void Modify_PatchSslPolicyRequest(ref PatchSslPolicyRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteSslPolicyRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -839,10 +984,13 @@ public override Operation Delete(DeleteSslPolicyRequest request, gaxgrpc::CallSe /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteSslPolicyRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -869,16 +1017,22 @@ public override SslPolicy Get(GetSslPolicyRequest request, gaxgrpc::CallSettings return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Returns the specified SSL policy resource. Gets a list of available SSL policies by making a list() request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertSslPolicyRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -887,10 +1041,13 @@ public override Operation Insert(InsertSslPolicyRequest request, gaxgrpc::CallSe /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertSslPolicyRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -941,16 +1098,22 @@ public override SslPoliciesListAvailableFeaturesResponse ListAvailableFeatures(L return _callListAvailableFeatures.Async(request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Patches the specified SSL policy with the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchSslPolicyRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -959,10 +1122,13 @@ public override Operation Patch(PatchSslPolicyRequest request, gaxgrpc::CallSett /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchSslPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchSslPolicyRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } } @@ -983,4 +1149,18 @@ public partial class SslPoliciesList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class SslPolicies + { + public partial class SslPoliciesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/SubnetworksClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/SubnetworksClient.g.cs index 80a4a1691ce2..d358c67773e4 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/SubnetworksClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/SubnetworksClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -46,15 +47,20 @@ private SubnetworksSettings(SubnetworksSettings existing) : base(existing) gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); ExpandIpCidrRangeSettings = existing.ExpandIpCidrRangeSettings; + ExpandIpCidrRangeOperationsSettings = existing.ExpandIpCidrRangeOperationsSettings.Clone(); GetSettings = existing.GetSettings; GetIamPolicySettings = existing.GetIamPolicySettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; ListUsableSettings = existing.ListUsableSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); SetIamPolicySettings = existing.SetIamPolicySettings; SetPrivateIpGoogleAccessSettings = existing.SetPrivateIpGoogleAccessSettings; + SetPrivateIpGoogleAccessOperationsSettings = existing.SetPrivateIpGoogleAccessOperationsSettings.Clone(); TestIamPermissionsSettings = existing.TestIamPermissionsSettings; OnCopy(existing); } @@ -85,6 +91,24 @@ private SubnetworksSettings(SubnetworksSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to SubnetworksClient.Delete and + /// SubnetworksClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// SubnetworksClient.ExpandIpCidrRange and SubnetworksClient.ExpandIpCidrRangeAsync. @@ -97,6 +121,24 @@ private SubnetworksSettings(SubnetworksSettings existing) : base(existing) /// public gaxgrpc::CallSettings ExpandIpCidrRangeSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to SubnetworksClient.ExpandIpCidrRange and + /// SubnetworksClient.ExpandIpCidrRangeAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings ExpandIpCidrRangeOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to SubnetworksClient.Get /// and SubnetworksClient.GetAsync. @@ -133,6 +175,24 @@ private SubnetworksSettings(SubnetworksSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to SubnetworksClient.Insert and + /// SubnetworksClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to SubnetworksClient.List /// and SubnetworksClient.ListAsync. @@ -169,6 +229,24 @@ private SubnetworksSettings(SubnetworksSettings existing) : base(existing) /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to SubnetworksClient.Patch and + /// SubnetworksClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// SubnetworksClient.SetIamPolicy and SubnetworksClient.SetIamPolicyAsync. @@ -194,6 +272,24 @@ private SubnetworksSettings(SubnetworksSettings existing) : base(existing) /// public gaxgrpc::CallSettings SetPrivateIpGoogleAccessSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to SubnetworksClient.SetPrivateIpGoogleAccess and + /// SubnetworksClient.SetPrivateIpGoogleAccessAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetPrivateIpGoogleAccessOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// SubnetworksClient.TestIamPermissions and SubnetworksClient.TestIamPermissionsAsync. @@ -444,7 +540,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -453,7 +549,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -462,9 +558,35 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteSubnetworkRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteSubnetworkRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified subnetwork. /// @@ -479,7 +601,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string subnetwork, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string subnetwork, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteSubnetworkRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -501,7 +623,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string subnetwork, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string subnetwork, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteSubnetworkRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -523,7 +645,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string subnetwork, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string subnetwork, st::CancellationToken cancellationToken) => DeleteAsync(project, region, subnetwork, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -532,7 +654,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation ExpandIpCidrRange(ExpandIpCidrRangeSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation ExpandIpCidrRange(ExpandIpCidrRangeSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -541,7 +663,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task ExpandIpCidrRangeAsync(ExpandIpCidrRangeSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> ExpandIpCidrRangeAsync(ExpandIpCidrRangeSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -550,9 +672,36 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task ExpandIpCidrRangeAsync(ExpandIpCidrRangeSubnetworkRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> ExpandIpCidrRangeAsync(ExpandIpCidrRangeSubnetworkRequest request, st::CancellationToken cancellationToken) => ExpandIpCidrRangeAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for ExpandIpCidrRange. + public virtual lro::OperationsClient ExpandIpCidrRangeOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of ExpandIpCidrRange + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceExpandIpCidrRange(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), ExpandIpCidrRangeOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// ExpandIpCidrRange. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceExpandIpCidrRangeAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), ExpandIpCidrRangeOperationsClient, callSettings); + /// /// Expands the IP CIDR range of the subnetwork to a specified value. /// @@ -570,7 +719,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation ExpandIpCidrRange(string project, string region, string subnetwork, SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation ExpandIpCidrRange(string project, string region, string subnetwork, SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource, gaxgrpc::CallSettings callSettings = null) => ExpandIpCidrRange(new ExpandIpCidrRangeSubnetworkRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -596,7 +745,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task ExpandIpCidrRangeAsync(string project, string region, string subnetwork, SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> ExpandIpCidrRangeAsync(string project, string region, string subnetwork, SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource, gaxgrpc::CallSettings callSettings = null) => ExpandIpCidrRangeAsync(new ExpandIpCidrRangeSubnetworkRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -622,7 +771,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task ExpandIpCidrRangeAsync(string project, string region, string subnetwork, SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> ExpandIpCidrRangeAsync(string project, string region, string subnetwork, SubnetworksExpandIpCidrRangeRequest subnetworksExpandIpCidrRangeRequestResource, st::CancellationToken cancellationToken) => ExpandIpCidrRangeAsync(project, region, subnetwork, subnetworksExpandIpCidrRangeRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -807,7 +956,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -816,7 +965,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -825,9 +974,35 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertSubnetworkRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertSubnetworkRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a subnetwork in the specified project using the data included in the request. /// @@ -842,7 +1017,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, Subnetwork subnetworkResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, Subnetwork subnetworkResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertSubnetworkRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -864,7 +1039,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, Subnetwork subnetworkResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, Subnetwork subnetworkResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertSubnetworkRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -886,7 +1061,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, Subnetwork subnetworkResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, Subnetwork subnetworkResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, subnetworkResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1035,7 +1210,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1044,7 +1219,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1053,9 +1228,35 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchSubnetworkRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchSubnetworkRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Patches the specified subnetwork with the data included in the request. Only certain fields can be updated with a patch request as indicated in the field descriptions. You must specify the current fingerprint of the subnetwork resource being patched. /// @@ -1073,7 +1274,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string region, string subnetwork, Subnetwork subnetworkResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string region, string subnetwork, Subnetwork subnetworkResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchSubnetworkRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1099,7 +1300,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, string subnetwork, Subnetwork subnetworkResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string region, string subnetwork, Subnetwork subnetworkResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchSubnetworkRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1125,7 +1326,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string region, string subnetwork, Subnetwork subnetworkResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string region, string subnetwork, Subnetwork subnetworkResource, st::CancellationToken cancellationToken) => PatchAsync(project, region, subnetwork, subnetworkResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1233,7 +1434,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetPrivateIpGoogleAccess(SetPrivateIpGoogleAccessSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetPrivateIpGoogleAccess(SetPrivateIpGoogleAccessSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1242,7 +1443,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetPrivateIpGoogleAccessAsync(SetPrivateIpGoogleAccessSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetPrivateIpGoogleAccessAsync(SetPrivateIpGoogleAccessSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1251,9 +1452,36 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetPrivateIpGoogleAccessAsync(SetPrivateIpGoogleAccessSubnetworkRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetPrivateIpGoogleAccessAsync(SetPrivateIpGoogleAccessSubnetworkRequest request, st::CancellationToken cancellationToken) => SetPrivateIpGoogleAccessAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetPrivateIpGoogleAccess. + public virtual lro::OperationsClient SetPrivateIpGoogleAccessOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of + /// SetPrivateIpGoogleAccess. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetPrivateIpGoogleAccess(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetPrivateIpGoogleAccessOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetPrivateIpGoogleAccess. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetPrivateIpGoogleAccessAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetPrivateIpGoogleAccessOperationsClient, callSettings); + /// /// Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. /// @@ -1271,7 +1499,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetPrivateIpGoogleAccess(string project, string region, string subnetwork, SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetPrivateIpGoogleAccess(string project, string region, string subnetwork, SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource, gaxgrpc::CallSettings callSettings = null) => SetPrivateIpGoogleAccess(new SetPrivateIpGoogleAccessSubnetworkRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1297,7 +1525,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetPrivateIpGoogleAccessAsync(string project, string region, string subnetwork, SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetPrivateIpGoogleAccessAsync(string project, string region, string subnetwork, SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource, gaxgrpc::CallSettings callSettings = null) => SetPrivateIpGoogleAccessAsync(new SetPrivateIpGoogleAccessSubnetworkRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1323,7 +1551,7 @@ internal static SubnetworksClient Create(grpccore::CallInvoker callInvoker, Subn /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetPrivateIpGoogleAccessAsync(string project, string region, string subnetwork, SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetPrivateIpGoogleAccessAsync(string project, string region, string subnetwork, SubnetworksSetPrivateIpGoogleAccessRequest subnetworksSetPrivateIpGoogleAccessRequestResource, st::CancellationToken cancellationToken) => SetPrivateIpGoogleAccessAsync(project, region, subnetwork, subnetworksSetPrivateIpGoogleAccessRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1466,6 +1694,11 @@ public SubnetworksClientImpl(Subnetworks.SubnetworksClient grpcClient, Subnetwor GrpcClient = grpcClient; SubnetworksSettings effectiveSettings = settings ?? SubnetworksSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + ExpandIpCidrRangeOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.ExpandIpCidrRangeOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.PatchOperationsSettings); + SetPrivateIpGoogleAccessOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.SetPrivateIpGoogleAccessOperationsSettings); _callAggregatedList = clientHelper.BuildApiCall(grpcClient.AggregatedListAsync, grpcClient.AggregatedList, effectiveSettings.AggregatedListSettings).WithGoogleRequestParam("project", request => request.Project); Modify_ApiCall(ref _callAggregatedList); Modify_AggregatedListApiCall(ref _callAggregatedList); @@ -1586,16 +1819,22 @@ public SubnetworksClientImpl(Subnetworks.SubnetworksClient grpcClient, Subnetwor return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified subnetwork. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteSubnetworkRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1604,22 +1843,31 @@ public override Operation Delete(DeleteSubnetworkRequest request, gaxgrpc::CallS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteSubnetworkRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } + /// The long-running operations client for ExpandIpCidrRange. + public override lro::OperationsClient ExpandIpCidrRangeOperationsClient { get; } + /// /// Expands the IP CIDR range of the subnetwork to a specified value. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation ExpandIpCidrRange(ExpandIpCidrRangeSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation ExpandIpCidrRange(ExpandIpCidrRangeSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ExpandIpCidrRangeSubnetworkRequest(ref request, ref callSettings); - return _callExpandIpCidrRange.Sync(request, callSettings); + Operation response = _callExpandIpCidrRange.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), ExpandIpCidrRangeOperationsClient); } /// @@ -1628,10 +1876,13 @@ public override Operation ExpandIpCidrRange(ExpandIpCidrRangeSubnetworkRequest r /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task ExpandIpCidrRangeAsync(ExpandIpCidrRangeSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> ExpandIpCidrRangeAsync(ExpandIpCidrRangeSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ExpandIpCidrRangeSubnetworkRequest(ref request, ref callSettings); - return _callExpandIpCidrRange.Async(request, callSettings); + Operation response = await _callExpandIpCidrRange.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), ExpandIpCidrRangeOperationsClient); } /// @@ -1682,16 +1933,22 @@ public override Policy GetIamPolicy(GetIamPolicySubnetworkRequest request, gaxgr return _callGetIamPolicy.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a subnetwork in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertSubnetworkRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1700,10 +1957,13 @@ public override Operation Insert(InsertSubnetworkRequest request, gaxgrpc::CallS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertSubnetworkRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1754,16 +2014,22 @@ public override Operation Insert(InsertSubnetworkRequest request, gaxgrpc::CallS return new gaxgrpc::GrpcPagedAsyncEnumerable(_callListUsable, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Patches the specified subnetwork with the data included in the request. Only certain fields can be updated with a patch request as indicated in the field descriptions. You must specify the current fingerprint of the subnetwork resource being patched. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchSubnetworkRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1772,10 +2038,13 @@ public override Operation Patch(PatchSubnetworkRequest request, gaxgrpc::CallSet /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchSubnetworkRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1802,16 +2071,22 @@ public override Policy SetIamPolicy(SetIamPolicySubnetworkRequest request, gaxgr return _callSetIamPolicy.Async(request, callSettings); } + /// The long-running operations client for SetPrivateIpGoogleAccess. + public override lro::OperationsClient SetPrivateIpGoogleAccessOperationsClient { get; } + /// /// Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetPrivateIpGoogleAccess(SetPrivateIpGoogleAccessSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetPrivateIpGoogleAccess(SetPrivateIpGoogleAccessSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetPrivateIpGoogleAccessSubnetworkRequest(ref request, ref callSettings); - return _callSetPrivateIpGoogleAccess.Sync(request, callSettings); + Operation response = _callSetPrivateIpGoogleAccess.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetPrivateIpGoogleAccessOperationsClient); } /// @@ -1820,10 +2095,13 @@ public override Operation SetPrivateIpGoogleAccess(SetPrivateIpGoogleAccessSubne /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetPrivateIpGoogleAccessAsync(SetPrivateIpGoogleAccessSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetPrivateIpGoogleAccessAsync(SetPrivateIpGoogleAccessSubnetworkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetPrivateIpGoogleAccessSubnetworkRequest(ref request, ref callSettings); - return _callSetPrivateIpGoogleAccess.Async(request, callSettings); + Operation response = await _callSetPrivateIpGoogleAccess.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetPrivateIpGoogleAccessOperationsClient); } /// @@ -1904,4 +2182,18 @@ public partial class UsableSubnetworksAggregatedList : gaxgrpc::IPageResponse GetEnumerator(); } + + public static partial class Subnetworks + { + public partial class SubnetworksClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetGrpcProxiesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetGrpcProxiesClient.g.cs index 4c9db659e1ec..216a7ce39b6b 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetGrpcProxiesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetGrpcProxiesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,10 +46,13 @@ private TargetGrpcProxiesSettings(TargetGrpcProxiesSettings existing) : base(exi { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); OnCopy(existing); } @@ -66,6 +70,24 @@ private TargetGrpcProxiesSettings(TargetGrpcProxiesSettings existing) : base(exi /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetGrpcProxiesClient.Delete and + /// TargetGrpcProxiesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to TargetGrpcProxiesClient.Get /// and TargetGrpcProxiesClient.GetAsync. @@ -90,6 +112,24 @@ private TargetGrpcProxiesSettings(TargetGrpcProxiesSettings existing) : base(exi /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetGrpcProxiesClient.Insert and + /// TargetGrpcProxiesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// TargetGrpcProxiesClient.List and TargetGrpcProxiesClient.ListAsync. @@ -114,6 +154,24 @@ private TargetGrpcProxiesSettings(TargetGrpcProxiesSettings existing) : base(exi /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetGrpcProxiesClient.Patch and + /// TargetGrpcProxiesClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public TargetGrpcProxiesSettings Clone() => new TargetGrpcProxiesSettings(this); @@ -283,7 +341,7 @@ internal static TargetGrpcProxiesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -292,7 +350,7 @@ internal static TargetGrpcProxiesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -301,9 +359,35 @@ internal static TargetGrpcProxiesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteTargetGrpcProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteTargetGrpcProxyRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified TargetGrpcProxy in the given scope /// @@ -315,7 +399,7 @@ internal static TargetGrpcProxiesClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string targetGrpcProxy, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string targetGrpcProxy, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteTargetGrpcProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -333,7 +417,7 @@ internal static TargetGrpcProxiesClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string targetGrpcProxy, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string targetGrpcProxy, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteTargetGrpcProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -351,7 +435,7 @@ internal static TargetGrpcProxiesClient Create(grpccore::CallInvoker callInvoker /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string targetGrpcProxy, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string targetGrpcProxy, st::CancellationToken cancellationToken) => DeleteAsync(project, targetGrpcProxy, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -437,7 +521,7 @@ internal static TargetGrpcProxiesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -446,7 +530,7 @@ internal static TargetGrpcProxiesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -455,9 +539,35 @@ internal static TargetGrpcProxiesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertTargetGrpcProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertTargetGrpcProxyRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a TargetGrpcProxy in the specified project in the given scope using the parameters that are included in the request. /// @@ -469,7 +579,7 @@ internal static TargetGrpcProxiesClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, TargetGrpcProxy targetGrpcProxyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, TargetGrpcProxy targetGrpcProxyResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertTargetGrpcProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -487,7 +597,7 @@ internal static TargetGrpcProxiesClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, TargetGrpcProxy targetGrpcProxyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, TargetGrpcProxy targetGrpcProxyResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertTargetGrpcProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -505,7 +615,7 @@ internal static TargetGrpcProxiesClient Create(grpccore::CallInvoker callInvoker /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, TargetGrpcProxy targetGrpcProxyResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, TargetGrpcProxy targetGrpcProxyResource, st::CancellationToken cancellationToken) => InsertAsync(project, targetGrpcProxyResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -580,7 +690,7 @@ internal static TargetGrpcProxiesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -589,7 +699,7 @@ internal static TargetGrpcProxiesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -598,9 +708,35 @@ internal static TargetGrpcProxiesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchTargetGrpcProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchTargetGrpcProxyRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Patches the specified TargetGrpcProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. /// @@ -615,7 +751,7 @@ internal static TargetGrpcProxiesClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string targetGrpcProxy, TargetGrpcProxy targetGrpcProxyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string targetGrpcProxy, TargetGrpcProxy targetGrpcProxyResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchTargetGrpcProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -637,7 +773,7 @@ internal static TargetGrpcProxiesClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string targetGrpcProxy, TargetGrpcProxy targetGrpcProxyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string targetGrpcProxy, TargetGrpcProxy targetGrpcProxyResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchTargetGrpcProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -659,7 +795,7 @@ internal static TargetGrpcProxiesClient Create(grpccore::CallInvoker callInvoker /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string targetGrpcProxy, TargetGrpcProxy targetGrpcProxyResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string targetGrpcProxy, TargetGrpcProxy targetGrpcProxyResource, st::CancellationToken cancellationToken) => PatchAsync(project, targetGrpcProxy, targetGrpcProxyResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -689,6 +825,9 @@ public TargetGrpcProxiesClientImpl(TargetGrpcProxies.TargetGrpcProxiesClient grp GrpcClient = grpcClient; TargetGrpcProxiesSettings effectiveSettings = settings ?? TargetGrpcProxiesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.PatchOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("target_grpc_proxy", request => request.TargetGrpcProxy); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -734,16 +873,22 @@ public TargetGrpcProxiesClientImpl(TargetGrpcProxies.TargetGrpcProxiesClient grp partial void Modify_PatchTargetGrpcProxyRequest(ref PatchTargetGrpcProxyRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified TargetGrpcProxy in the given scope /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteTargetGrpcProxyRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -752,10 +897,13 @@ public override Operation Delete(DeleteTargetGrpcProxyRequest request, gaxgrpc:: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteTargetGrpcProxyRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -782,16 +930,22 @@ public override TargetGrpcProxy Get(GetTargetGrpcProxyRequest request, gaxgrpc:: return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a TargetGrpcProxy in the specified project in the given scope using the parameters that are included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertTargetGrpcProxyRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -800,10 +954,13 @@ public override Operation Insert(InsertTargetGrpcProxyRequest request, gaxgrpc:: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertTargetGrpcProxyRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -830,16 +987,22 @@ public override Operation Insert(InsertTargetGrpcProxyRequest request, gaxgrpc:: return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Patches the specified TargetGrpcProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchTargetGrpcProxyRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -848,10 +1011,13 @@ public override Operation Patch(PatchTargetGrpcProxyRequest request, gaxgrpc::Ca /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchTargetGrpcProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchTargetGrpcProxyRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } } @@ -872,4 +1038,18 @@ public partial class TargetGrpcProxyList : gaxgrpc::IPageResponse GetEnumerator(); } + + public static partial class TargetGrpcProxies + { + public partial class TargetGrpcProxiesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetHttpProxiesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetHttpProxiesClient.g.cs index 89030289ca71..03e2f339fc19 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetHttpProxiesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetHttpProxiesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -46,11 +47,15 @@ private TargetHttpProxiesSettings(TargetHttpProxiesSettings existing) : base(exi gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); SetUrlMapSettings = existing.SetUrlMapSettings; + SetUrlMapOperationsSettings = existing.SetUrlMapOperationsSettings.Clone(); OnCopy(existing); } @@ -80,6 +85,24 @@ private TargetHttpProxiesSettings(TargetHttpProxiesSettings existing) : base(exi /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetHttpProxiesClient.Delete and + /// TargetHttpProxiesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to TargetHttpProxiesClient.Get /// and TargetHttpProxiesClient.GetAsync. @@ -104,6 +127,24 @@ private TargetHttpProxiesSettings(TargetHttpProxiesSettings existing) : base(exi /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetHttpProxiesClient.Insert and + /// TargetHttpProxiesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// TargetHttpProxiesClient.List and TargetHttpProxiesClient.ListAsync. @@ -128,6 +169,24 @@ private TargetHttpProxiesSettings(TargetHttpProxiesSettings existing) : base(exi /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetHttpProxiesClient.Patch and + /// TargetHttpProxiesClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// TargetHttpProxiesClient.SetUrlMap and TargetHttpProxiesClient.SetUrlMapAsync. @@ -140,6 +199,24 @@ private TargetHttpProxiesSettings(TargetHttpProxiesSettings existing) : base(exi /// public gaxgrpc::CallSettings SetUrlMapSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetHttpProxiesClient.SetUrlMap and + /// TargetHttpProxiesClient.SetUrlMapAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetUrlMapOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public TargetHttpProxiesSettings Clone() => new TargetHttpProxiesSettings(this); @@ -379,7 +456,7 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -388,7 +465,7 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -397,9 +474,35 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteTargetHttpProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteTargetHttpProxyRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified TargetHttpProxy resource. /// @@ -411,7 +514,7 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string targetHttpProxy, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string targetHttpProxy, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteTargetHttpProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -429,7 +532,7 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string targetHttpProxy, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string targetHttpProxy, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteTargetHttpProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -447,7 +550,7 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string targetHttpProxy, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string targetHttpProxy, st::CancellationToken cancellationToken) => DeleteAsync(project, targetHttpProxy, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -533,7 +636,7 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -542,7 +645,7 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -551,9 +654,35 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertTargetHttpProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertTargetHttpProxyRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a TargetHttpProxy resource in the specified project using the data included in the request. /// @@ -565,7 +694,7 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, TargetHttpProxy targetHttpProxyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, TargetHttpProxy targetHttpProxyResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertTargetHttpProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -583,7 +712,7 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, TargetHttpProxy targetHttpProxyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, TargetHttpProxy targetHttpProxyResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertTargetHttpProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -601,7 +730,7 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, TargetHttpProxy targetHttpProxyResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, TargetHttpProxy targetHttpProxyResource, st::CancellationToken cancellationToken) => InsertAsync(project, targetHttpProxyResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -676,7 +805,7 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -685,7 +814,7 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -694,9 +823,35 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchTargetHttpProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchTargetHttpProxyRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Patches the specified TargetHttpProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. (== suppress_warning http-rest-shadowed ==) /// @@ -711,7 +866,7 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string targetHttpProxy, TargetHttpProxy targetHttpProxyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string targetHttpProxy, TargetHttpProxy targetHttpProxyResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchTargetHttpProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -733,7 +888,7 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string targetHttpProxy, TargetHttpProxy targetHttpProxyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string targetHttpProxy, TargetHttpProxy targetHttpProxyResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchTargetHttpProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -755,7 +910,7 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string targetHttpProxy, TargetHttpProxy targetHttpProxyResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string targetHttpProxy, TargetHttpProxy targetHttpProxyResource, st::CancellationToken cancellationToken) => PatchAsync(project, targetHttpProxy, targetHttpProxyResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -764,7 +919,7 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetUrlMap(SetUrlMapTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetUrlMap(SetUrlMapTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -773,7 +928,7 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetUrlMapAsync(SetUrlMapTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetUrlMapAsync(SetUrlMapTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -782,9 +937,35 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetUrlMapAsync(SetUrlMapTargetHttpProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetUrlMapAsync(SetUrlMapTargetHttpProxyRequest request, st::CancellationToken cancellationToken) => SetUrlMapAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetUrlMap. + public virtual lro::OperationsClient SetUrlMapOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetUrlMap. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetUrlMap(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetUrlMapOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetUrlMap. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetUrlMapAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetUrlMapOperationsClient, callSettings); + /// /// Changes the URL map for TargetHttpProxy. /// @@ -799,7 +980,7 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetUrlMap(string project, string targetHttpProxy, UrlMapReference urlMapReferenceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetUrlMap(string project, string targetHttpProxy, UrlMapReference urlMapReferenceResource, gaxgrpc::CallSettings callSettings = null) => SetUrlMap(new SetUrlMapTargetHttpProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -821,7 +1002,7 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetUrlMapAsync(string project, string targetHttpProxy, UrlMapReference urlMapReferenceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetUrlMapAsync(string project, string targetHttpProxy, UrlMapReference urlMapReferenceResource, gaxgrpc::CallSettings callSettings = null) => SetUrlMapAsync(new SetUrlMapTargetHttpProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -843,7 +1024,7 @@ internal static TargetHttpProxiesClient Create(grpccore::CallInvoker callInvoker /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetUrlMapAsync(string project, string targetHttpProxy, UrlMapReference urlMapReferenceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetUrlMapAsync(string project, string targetHttpProxy, UrlMapReference urlMapReferenceResource, st::CancellationToken cancellationToken) => SetUrlMapAsync(project, targetHttpProxy, urlMapReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -877,6 +1058,10 @@ public TargetHttpProxiesClientImpl(TargetHttpProxies.TargetHttpProxiesClient grp GrpcClient = grpcClient; TargetHttpProxiesSettings effectiveSettings = settings ?? TargetHttpProxiesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.PatchOperationsSettings); + SetUrlMapOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.SetUrlMapOperationsSettings); _callAggregatedList = clientHelper.BuildApiCall(grpcClient.AggregatedListAsync, grpcClient.AggregatedList, effectiveSettings.AggregatedListSettings).WithGoogleRequestParam("project", request => request.Project); Modify_ApiCall(ref _callAggregatedList); Modify_AggregatedListApiCall(ref _callAggregatedList); @@ -962,16 +1147,22 @@ public TargetHttpProxiesClientImpl(TargetHttpProxies.TargetHttpProxiesClient grp return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified TargetHttpProxy resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteTargetHttpProxyRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -980,10 +1171,13 @@ public override Operation Delete(DeleteTargetHttpProxyRequest request, gaxgrpc:: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteTargetHttpProxyRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1010,16 +1204,22 @@ public override TargetHttpProxy Get(GetTargetHttpProxyRequest request, gaxgrpc:: return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a TargetHttpProxy resource in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertTargetHttpProxyRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1028,10 +1228,13 @@ public override Operation Insert(InsertTargetHttpProxyRequest request, gaxgrpc:: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertTargetHttpProxyRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1058,16 +1261,22 @@ public override Operation Insert(InsertTargetHttpProxyRequest request, gaxgrpc:: return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Patches the specified TargetHttpProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. (== suppress_warning http-rest-shadowed ==) /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchTargetHttpProxyRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1076,22 +1285,31 @@ public override Operation Patch(PatchTargetHttpProxyRequest request, gaxgrpc::Ca /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchTargetHttpProxyRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } + /// The long-running operations client for SetUrlMap. + public override lro::OperationsClient SetUrlMapOperationsClient { get; } + /// /// Changes the URL map for TargetHttpProxy. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetUrlMap(SetUrlMapTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetUrlMap(SetUrlMapTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetUrlMapTargetHttpProxyRequest(ref request, ref callSettings); - return _callSetUrlMap.Sync(request, callSettings); + Operation response = _callSetUrlMap.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetUrlMapOperationsClient); } /// @@ -1100,10 +1318,13 @@ public override Operation SetUrlMap(SetUrlMapTargetHttpProxyRequest request, gax /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetUrlMapAsync(SetUrlMapTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetUrlMapAsync(SetUrlMapTargetHttpProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetUrlMapTargetHttpProxyRequest(ref request, ref callSettings); - return _callSetUrlMap.Async(request, callSettings); + Operation response = await _callSetUrlMap.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetUrlMapOperationsClient); } } @@ -1135,4 +1356,18 @@ public partial class TargetHttpProxyAggregatedList : gaxgrpc::IPageResponse GetEnumerator(); } + + public static partial class TargetHttpProxies + { + public partial class TargetHttpProxiesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetHttpsProxiesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetHttpsProxiesClient.g.cs index 37d90c3c8e17..b0545d216288 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetHttpsProxiesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetHttpsProxiesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -46,14 +47,21 @@ private TargetHttpsProxiesSettings(TargetHttpsProxiesSettings existing) : base(e gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); SetQuicOverrideSettings = existing.SetQuicOverrideSettings; + SetQuicOverrideOperationsSettings = existing.SetQuicOverrideOperationsSettings.Clone(); SetSslCertificatesSettings = existing.SetSslCertificatesSettings; + SetSslCertificatesOperationsSettings = existing.SetSslCertificatesOperationsSettings.Clone(); SetSslPolicySettings = existing.SetSslPolicySettings; + SetSslPolicyOperationsSettings = existing.SetSslPolicyOperationsSettings.Clone(); SetUrlMapSettings = existing.SetUrlMapSettings; + SetUrlMapOperationsSettings = existing.SetUrlMapOperationsSettings.Clone(); OnCopy(existing); } @@ -83,6 +91,24 @@ private TargetHttpsProxiesSettings(TargetHttpsProxiesSettings existing) : base(e /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetHttpsProxiesClient.Delete and + /// TargetHttpsProxiesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// TargetHttpsProxiesClient.Get and TargetHttpsProxiesClient.GetAsync. @@ -107,6 +133,24 @@ private TargetHttpsProxiesSettings(TargetHttpsProxiesSettings existing) : base(e /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetHttpsProxiesClient.Insert and + /// TargetHttpsProxiesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// TargetHttpsProxiesClient.List and TargetHttpsProxiesClient.ListAsync. @@ -131,6 +175,24 @@ private TargetHttpsProxiesSettings(TargetHttpsProxiesSettings existing) : base(e /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetHttpsProxiesClient.Patch and + /// TargetHttpsProxiesClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// TargetHttpsProxiesClient.SetQuicOverride and TargetHttpsProxiesClient.SetQuicOverrideAsync. @@ -143,6 +205,24 @@ private TargetHttpsProxiesSettings(TargetHttpsProxiesSettings existing) : base(e /// public gaxgrpc::CallSettings SetQuicOverrideSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetHttpsProxiesClient.SetQuicOverride and + /// TargetHttpsProxiesClient.SetQuicOverrideAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetQuicOverrideOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// TargetHttpsProxiesClient.SetSslCertificates and TargetHttpsProxiesClient.SetSslCertificatesAsync @@ -156,6 +236,24 @@ private TargetHttpsProxiesSettings(TargetHttpsProxiesSettings existing) : base(e /// public gaxgrpc::CallSettings SetSslCertificatesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetHttpsProxiesClient.SetSslCertificates and + /// TargetHttpsProxiesClient.SetSslCertificatesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetSslCertificatesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// TargetHttpsProxiesClient.SetSslPolicy and TargetHttpsProxiesClient.SetSslPolicyAsync. @@ -168,6 +266,24 @@ private TargetHttpsProxiesSettings(TargetHttpsProxiesSettings existing) : base(e /// public gaxgrpc::CallSettings SetSslPolicySettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetHttpsProxiesClient.SetSslPolicy and + /// TargetHttpsProxiesClient.SetSslPolicyAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetSslPolicyOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// TargetHttpsProxiesClient.SetUrlMap and TargetHttpsProxiesClient.SetUrlMapAsync. @@ -180,6 +296,24 @@ private TargetHttpsProxiesSettings(TargetHttpsProxiesSettings existing) : base(e /// public gaxgrpc::CallSettings SetUrlMapSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetHttpsProxiesClient.SetUrlMap and + /// TargetHttpsProxiesClient.SetUrlMapAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetUrlMapOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public TargetHttpsProxiesSettings Clone() => new TargetHttpsProxiesSettings(this); @@ -422,7 +556,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -431,7 +565,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -440,9 +574,35 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteTargetHttpsProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteTargetHttpsProxyRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified TargetHttpsProxy resource. /// @@ -454,7 +614,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string targetHttpsProxy, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string targetHttpsProxy, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteTargetHttpsProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -472,7 +632,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string targetHttpsProxy, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string targetHttpsProxy, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteTargetHttpsProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -490,7 +650,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string targetHttpsProxy, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string targetHttpsProxy, st::CancellationToken cancellationToken) => DeleteAsync(project, targetHttpsProxy, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -576,7 +736,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -585,7 +745,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -594,9 +754,35 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertTargetHttpsProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertTargetHttpsProxyRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a TargetHttpsProxy resource in the specified project using the data included in the request. /// @@ -608,7 +794,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, TargetHttpsProxy targetHttpsProxyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, TargetHttpsProxy targetHttpsProxyResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertTargetHttpsProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -626,7 +812,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, TargetHttpsProxy targetHttpsProxyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, TargetHttpsProxy targetHttpsProxyResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertTargetHttpsProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -644,7 +830,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, TargetHttpsProxy targetHttpsProxyResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, TargetHttpsProxy targetHttpsProxyResource, st::CancellationToken cancellationToken) => InsertAsync(project, targetHttpsProxyResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -719,7 +905,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -728,7 +914,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -737,9 +923,35 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchTargetHttpsProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchTargetHttpsProxyRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Patches the specified TargetHttpsProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. (== suppress_warning http-rest-shadowed ==) /// @@ -754,7 +966,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string targetHttpsProxy, TargetHttpsProxy targetHttpsProxyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string targetHttpsProxy, TargetHttpsProxy targetHttpsProxyResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchTargetHttpsProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -776,7 +988,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string targetHttpsProxy, TargetHttpsProxy targetHttpsProxyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string targetHttpsProxy, TargetHttpsProxy targetHttpsProxyResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchTargetHttpsProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -798,7 +1010,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string targetHttpsProxy, TargetHttpsProxy targetHttpsProxyResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string targetHttpsProxy, TargetHttpsProxy targetHttpsProxyResource, st::CancellationToken cancellationToken) => PatchAsync(project, targetHttpsProxy, targetHttpsProxyResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -807,7 +1019,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetQuicOverride(SetQuicOverrideTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetQuicOverride(SetQuicOverrideTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -816,7 +1028,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetQuicOverrideAsync(SetQuicOverrideTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetQuicOverrideAsync(SetQuicOverrideTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -825,9 +1037,35 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetQuicOverrideAsync(SetQuicOverrideTargetHttpsProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetQuicOverrideAsync(SetQuicOverrideTargetHttpsProxyRequest request, st::CancellationToken cancellationToken) => SetQuicOverrideAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetQuicOverride. + public virtual lro::OperationsClient SetQuicOverrideOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetQuicOverride. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetQuicOverride(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetQuicOverrideOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetQuicOverride. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetQuicOverrideAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetQuicOverrideOperationsClient, callSettings); + /// /// Sets the QUIC override policy for TargetHttpsProxy. /// @@ -842,7 +1080,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetQuicOverride(string project, string targetHttpsProxy, TargetHttpsProxiesSetQuicOverrideRequest targetHttpsProxiesSetQuicOverrideRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetQuicOverride(string project, string targetHttpsProxy, TargetHttpsProxiesSetQuicOverrideRequest targetHttpsProxiesSetQuicOverrideRequestResource, gaxgrpc::CallSettings callSettings = null) => SetQuicOverride(new SetQuicOverrideTargetHttpsProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -864,7 +1102,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetQuicOverrideAsync(string project, string targetHttpsProxy, TargetHttpsProxiesSetQuicOverrideRequest targetHttpsProxiesSetQuicOverrideRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetQuicOverrideAsync(string project, string targetHttpsProxy, TargetHttpsProxiesSetQuicOverrideRequest targetHttpsProxiesSetQuicOverrideRequestResource, gaxgrpc::CallSettings callSettings = null) => SetQuicOverrideAsync(new SetQuicOverrideTargetHttpsProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -886,7 +1124,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetQuicOverrideAsync(string project, string targetHttpsProxy, TargetHttpsProxiesSetQuicOverrideRequest targetHttpsProxiesSetQuicOverrideRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetQuicOverrideAsync(string project, string targetHttpsProxy, TargetHttpsProxiesSetQuicOverrideRequest targetHttpsProxiesSetQuicOverrideRequestResource, st::CancellationToken cancellationToken) => SetQuicOverrideAsync(project, targetHttpsProxy, targetHttpsProxiesSetQuicOverrideRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -895,7 +1133,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetSslCertificates(SetSslCertificatesTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetSslCertificates(SetSslCertificatesTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -904,7 +1142,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetSslCertificatesAsync(SetSslCertificatesTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetSslCertificatesAsync(SetSslCertificatesTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -913,9 +1151,36 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetSslCertificatesAsync(SetSslCertificatesTargetHttpsProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetSslCertificatesAsync(SetSslCertificatesTargetHttpsProxyRequest request, st::CancellationToken cancellationToken) => SetSslCertificatesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetSslCertificates. + public virtual lro::OperationsClient SetSslCertificatesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetSslCertificates + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetSslCertificates(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetSslCertificatesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetSslCertificates. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetSslCertificatesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetSslCertificatesOperationsClient, callSettings); + /// /// Replaces SslCertificates for TargetHttpsProxy. /// @@ -930,7 +1195,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetSslCertificates(string project, string targetHttpsProxy, TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetSslCertificates(string project, string targetHttpsProxy, TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource, gaxgrpc::CallSettings callSettings = null) => SetSslCertificates(new SetSslCertificatesTargetHttpsProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -952,7 +1217,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetSslCertificatesAsync(string project, string targetHttpsProxy, TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetSslCertificatesAsync(string project, string targetHttpsProxy, TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource, gaxgrpc::CallSettings callSettings = null) => SetSslCertificatesAsync(new SetSslCertificatesTargetHttpsProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -974,7 +1239,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetSslCertificatesAsync(string project, string targetHttpsProxy, TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetSslCertificatesAsync(string project, string targetHttpsProxy, TargetHttpsProxiesSetSslCertificatesRequest targetHttpsProxiesSetSslCertificatesRequestResource, st::CancellationToken cancellationToken) => SetSslCertificatesAsync(project, targetHttpsProxy, targetHttpsProxiesSetSslCertificatesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -983,7 +1248,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetSslPolicy(SetSslPolicyTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetSslPolicy(SetSslPolicyTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -992,7 +1257,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetSslPolicyAsync(SetSslPolicyTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetSslPolicyAsync(SetSslPolicyTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1001,9 +1266,35 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetSslPolicyAsync(SetSslPolicyTargetHttpsProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetSslPolicyAsync(SetSslPolicyTargetHttpsProxyRequest request, st::CancellationToken cancellationToken) => SetSslPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetSslPolicy. + public virtual lro::OperationsClient SetSslPolicyOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetSslPolicy. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetSslPolicy(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetSslPolicyOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetSslPolicy. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetSslPolicyAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetSslPolicyOperationsClient, callSettings); + /// /// Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the HTTPS proxy load balancer. They do not affect the connection between the load balancer and the backends. /// @@ -1018,7 +1309,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetSslPolicy(string project, string targetHttpsProxy, SslPolicyReference sslPolicyReferenceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetSslPolicy(string project, string targetHttpsProxy, SslPolicyReference sslPolicyReferenceResource, gaxgrpc::CallSettings callSettings = null) => SetSslPolicy(new SetSslPolicyTargetHttpsProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1040,7 +1331,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetSslPolicyAsync(string project, string targetHttpsProxy, SslPolicyReference sslPolicyReferenceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetSslPolicyAsync(string project, string targetHttpsProxy, SslPolicyReference sslPolicyReferenceResource, gaxgrpc::CallSettings callSettings = null) => SetSslPolicyAsync(new SetSslPolicyTargetHttpsProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1062,7 +1353,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetSslPolicyAsync(string project, string targetHttpsProxy, SslPolicyReference sslPolicyReferenceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetSslPolicyAsync(string project, string targetHttpsProxy, SslPolicyReference sslPolicyReferenceResource, st::CancellationToken cancellationToken) => SetSslPolicyAsync(project, targetHttpsProxy, sslPolicyReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1071,7 +1362,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetUrlMap(SetUrlMapTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetUrlMap(SetUrlMapTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1080,7 +1371,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetUrlMapAsync(SetUrlMapTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetUrlMapAsync(SetUrlMapTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1089,9 +1380,35 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetUrlMapAsync(SetUrlMapTargetHttpsProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetUrlMapAsync(SetUrlMapTargetHttpsProxyRequest request, st::CancellationToken cancellationToken) => SetUrlMapAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetUrlMap. + public virtual lro::OperationsClient SetUrlMapOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetUrlMap. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetUrlMap(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetUrlMapOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetUrlMap. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetUrlMapAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetUrlMapOperationsClient, callSettings); + /// /// Changes the URL map for TargetHttpsProxy. /// @@ -1106,7 +1423,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetUrlMap(string project, string targetHttpsProxy, UrlMapReference urlMapReferenceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetUrlMap(string project, string targetHttpsProxy, UrlMapReference urlMapReferenceResource, gaxgrpc::CallSettings callSettings = null) => SetUrlMap(new SetUrlMapTargetHttpsProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1128,7 +1445,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetUrlMapAsync(string project, string targetHttpsProxy, UrlMapReference urlMapReferenceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetUrlMapAsync(string project, string targetHttpsProxy, UrlMapReference urlMapReferenceResource, gaxgrpc::CallSettings callSettings = null) => SetUrlMapAsync(new SetUrlMapTargetHttpsProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1150,7 +1467,7 @@ internal static TargetHttpsProxiesClient Create(grpccore::CallInvoker callInvoke /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetUrlMapAsync(string project, string targetHttpsProxy, UrlMapReference urlMapReferenceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetUrlMapAsync(string project, string targetHttpsProxy, UrlMapReference urlMapReferenceResource, st::CancellationToken cancellationToken) => SetUrlMapAsync(project, targetHttpsProxy, urlMapReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -1190,6 +1507,13 @@ public TargetHttpsProxiesClientImpl(TargetHttpsProxies.TargetHttpsProxiesClient GrpcClient = grpcClient; TargetHttpsProxiesSettings effectiveSettings = settings ?? TargetHttpsProxiesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.PatchOperationsSettings); + SetQuicOverrideOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.SetQuicOverrideOperationsSettings); + SetSslCertificatesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.SetSslCertificatesOperationsSettings); + SetSslPolicyOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.SetSslPolicyOperationsSettings); + SetUrlMapOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.SetUrlMapOperationsSettings); _callAggregatedList = clientHelper.BuildApiCall(grpcClient.AggregatedListAsync, grpcClient.AggregatedList, effectiveSettings.AggregatedListSettings).WithGoogleRequestParam("project", request => request.Project); Modify_ApiCall(ref _callAggregatedList); Modify_AggregatedListApiCall(ref _callAggregatedList); @@ -1296,16 +1620,22 @@ public TargetHttpsProxiesClientImpl(TargetHttpsProxies.TargetHttpsProxiesClient return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified TargetHttpsProxy resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteTargetHttpsProxyRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1314,10 +1644,13 @@ public override Operation Delete(DeleteTargetHttpsProxyRequest request, gaxgrpc: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteTargetHttpsProxyRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1344,16 +1677,22 @@ public override TargetHttpsProxy Get(GetTargetHttpsProxyRequest request, gaxgrpc return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a TargetHttpsProxy resource in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertTargetHttpsProxyRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1362,10 +1701,13 @@ public override Operation Insert(InsertTargetHttpsProxyRequest request, gaxgrpc: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertTargetHttpsProxyRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1392,16 +1734,22 @@ public override Operation Insert(InsertTargetHttpsProxyRequest request, gaxgrpc: return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Patches the specified TargetHttpsProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. (== suppress_warning http-rest-shadowed ==) /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchTargetHttpsProxyRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1410,22 +1758,31 @@ public override Operation Patch(PatchTargetHttpsProxyRequest request, gaxgrpc::C /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchTargetHttpsProxyRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } + /// The long-running operations client for SetQuicOverride. + public override lro::OperationsClient SetQuicOverrideOperationsClient { get; } + /// /// Sets the QUIC override policy for TargetHttpsProxy. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetQuicOverride(SetQuicOverrideTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetQuicOverride(SetQuicOverrideTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetQuicOverrideTargetHttpsProxyRequest(ref request, ref callSettings); - return _callSetQuicOverride.Sync(request, callSettings); + Operation response = _callSetQuicOverride.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetQuicOverrideOperationsClient); } /// @@ -1434,22 +1791,31 @@ public override Operation SetQuicOverride(SetQuicOverrideTargetHttpsProxyRequest /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetQuicOverrideAsync(SetQuicOverrideTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetQuicOverrideAsync(SetQuicOverrideTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetQuicOverrideTargetHttpsProxyRequest(ref request, ref callSettings); - return _callSetQuicOverride.Async(request, callSettings); + Operation response = await _callSetQuicOverride.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetQuicOverrideOperationsClient); } + /// The long-running operations client for SetSslCertificates. + public override lro::OperationsClient SetSslCertificatesOperationsClient { get; } + /// /// Replaces SslCertificates for TargetHttpsProxy. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetSslCertificates(SetSslCertificatesTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetSslCertificates(SetSslCertificatesTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetSslCertificatesTargetHttpsProxyRequest(ref request, ref callSettings); - return _callSetSslCertificates.Sync(request, callSettings); + Operation response = _callSetSslCertificates.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetSslCertificatesOperationsClient); } /// @@ -1458,22 +1824,31 @@ public override Operation SetSslCertificates(SetSslCertificatesTargetHttpsProxyR /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetSslCertificatesAsync(SetSslCertificatesTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetSslCertificatesAsync(SetSslCertificatesTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetSslCertificatesTargetHttpsProxyRequest(ref request, ref callSettings); - return _callSetSslCertificates.Async(request, callSettings); + Operation response = await _callSetSslCertificates.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetSslCertificatesOperationsClient); } + /// The long-running operations client for SetSslPolicy. + public override lro::OperationsClient SetSslPolicyOperationsClient { get; } + /// /// Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the HTTPS proxy load balancer. They do not affect the connection between the load balancer and the backends. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetSslPolicy(SetSslPolicyTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetSslPolicy(SetSslPolicyTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetSslPolicyTargetHttpsProxyRequest(ref request, ref callSettings); - return _callSetSslPolicy.Sync(request, callSettings); + Operation response = _callSetSslPolicy.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetSslPolicyOperationsClient); } /// @@ -1482,22 +1857,31 @@ public override Operation SetSslPolicy(SetSslPolicyTargetHttpsProxyRequest reque /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetSslPolicyAsync(SetSslPolicyTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetSslPolicyAsync(SetSslPolicyTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetSslPolicyTargetHttpsProxyRequest(ref request, ref callSettings); - return _callSetSslPolicy.Async(request, callSettings); + Operation response = await _callSetSslPolicy.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetSslPolicyOperationsClient); } + /// The long-running operations client for SetUrlMap. + public override lro::OperationsClient SetUrlMapOperationsClient { get; } + /// /// Changes the URL map for TargetHttpsProxy. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetUrlMap(SetUrlMapTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetUrlMap(SetUrlMapTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetUrlMapTargetHttpsProxyRequest(ref request, ref callSettings); - return _callSetUrlMap.Sync(request, callSettings); + Operation response = _callSetUrlMap.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetUrlMapOperationsClient); } /// @@ -1506,10 +1890,13 @@ public override Operation SetUrlMap(SetUrlMapTargetHttpsProxyRequest request, ga /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetUrlMapAsync(SetUrlMapTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetUrlMapAsync(SetUrlMapTargetHttpsProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetUrlMapTargetHttpsProxyRequest(ref request, ref callSettings); - return _callSetUrlMap.Async(request, callSettings); + Operation response = await _callSetUrlMap.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetUrlMapOperationsClient); } } @@ -1541,4 +1928,18 @@ public partial class TargetHttpsProxyAggregatedList : gaxgrpc::IPageResponse GetEnumerator(); } + + public static partial class TargetHttpsProxies + { + public partial class TargetHttpsProxiesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetInstancesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetInstancesClient.g.cs index ddaf17771483..edab32bf8b60 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetInstancesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetInstancesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -46,8 +47,10 @@ private TargetInstancesSettings(TargetInstancesSettings existing) : base(existin gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; OnCopy(existing); } @@ -78,6 +81,24 @@ private TargetInstancesSettings(TargetInstancesSettings existing) : base(existin /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetInstancesClient.Delete and + /// TargetInstancesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to TargetInstancesClient.Get /// and TargetInstancesClient.GetAsync. @@ -102,6 +123,24 @@ private TargetInstancesSettings(TargetInstancesSettings existing) : base(existin /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetInstancesClient.Insert and + /// TargetInstancesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to TargetInstancesClient.List /// and TargetInstancesClient.ListAsync. @@ -353,7 +392,7 @@ internal static TargetInstancesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteTargetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteTargetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -362,7 +401,7 @@ internal static TargetInstancesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteTargetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteTargetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -371,9 +410,35 @@ internal static TargetInstancesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteTargetInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteTargetInstanceRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified TargetInstance resource. /// @@ -388,7 +453,7 @@ internal static TargetInstancesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string zone, string targetInstance, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string zone, string targetInstance, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteTargetInstanceRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -410,7 +475,7 @@ internal static TargetInstancesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string zone, string targetInstance, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string zone, string targetInstance, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteTargetInstanceRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -432,7 +497,7 @@ internal static TargetInstancesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string zone, string targetInstance, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string zone, string targetInstance, st::CancellationToken cancellationToken) => DeleteAsync(project, zone, targetInstance, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -529,7 +594,7 @@ internal static TargetInstancesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertTargetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertTargetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -538,7 +603,7 @@ internal static TargetInstancesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertTargetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertTargetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -547,9 +612,35 @@ internal static TargetInstancesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertTargetInstanceRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertTargetInstanceRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a TargetInstance resource in the specified project and zone using the data included in the request. /// @@ -564,7 +655,7 @@ internal static TargetInstancesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string zone, TargetInstance targetInstanceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string zone, TargetInstance targetInstanceResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertTargetInstanceRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -586,7 +677,7 @@ internal static TargetInstancesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string zone, TargetInstance targetInstanceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string zone, TargetInstance targetInstanceResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertTargetInstanceRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -608,7 +699,7 @@ internal static TargetInstancesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string zone, TargetInstance targetInstanceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string zone, TargetInstance targetInstanceResource, st::CancellationToken cancellationToken) => InsertAsync(project, zone, targetInstanceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -712,6 +803,8 @@ public TargetInstancesClientImpl(TargetInstances.TargetInstancesClient grpcClien GrpcClient = grpcClient; TargetInstancesSettings effectiveSettings = settings ?? TargetInstancesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForZoneOperations(), effectiveSettings.InsertOperationsSettings); _callAggregatedList = clientHelper.BuildApiCall(grpcClient.AggregatedListAsync, grpcClient.AggregatedList, effectiveSettings.AggregatedListSettings).WithGoogleRequestParam("project", request => request.Project); Modify_ApiCall(ref _callAggregatedList); Modify_AggregatedListApiCall(ref _callAggregatedList); @@ -783,16 +876,22 @@ public TargetInstancesClientImpl(TargetInstances.TargetInstancesClient grpcClien return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified TargetInstance resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteTargetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteTargetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteTargetInstanceRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -801,10 +900,13 @@ public override Operation Delete(DeleteTargetInstanceRequest request, gaxgrpc::C /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteTargetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteTargetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteTargetInstanceRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -831,16 +933,22 @@ public override TargetInstance Get(GetTargetInstanceRequest request, gaxgrpc::Ca return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a TargetInstance resource in the specified project and zone using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertTargetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertTargetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertTargetInstanceRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -849,10 +957,13 @@ public override Operation Insert(InsertTargetInstanceRequest request, gaxgrpc::C /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertTargetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertTargetInstanceRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertTargetInstanceRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetZoneOperationRequest pollRequest = GetZoneOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -916,4 +1027,18 @@ public partial class TargetInstanceList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class TargetInstances + { + public partial class TargetInstancesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to ZoneOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForZoneOperations() => + ZoneOperations.ZoneOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetPoolsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetPoolsClient.g.cs index 71b6585107a8..425e6949f1e0 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetPoolsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetPoolsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,16 +46,23 @@ private TargetPoolsSettings(TargetPoolsSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AddHealthCheckSettings = existing.AddHealthCheckSettings; + AddHealthCheckOperationsSettings = existing.AddHealthCheckOperationsSettings.Clone(); AddInstanceSettings = existing.AddInstanceSettings; + AddInstanceOperationsSettings = existing.AddInstanceOperationsSettings.Clone(); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; GetHealthSettings = existing.GetHealthSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; RemoveHealthCheckSettings = existing.RemoveHealthCheckSettings; + RemoveHealthCheckOperationsSettings = existing.RemoveHealthCheckOperationsSettings.Clone(); RemoveInstanceSettings = existing.RemoveInstanceSettings; + RemoveInstanceOperationsSettings = existing.RemoveInstanceOperationsSettings.Clone(); SetBackupSettings = existing.SetBackupSettings; + SetBackupOperationsSettings = existing.SetBackupOperationsSettings.Clone(); OnCopy(existing); } @@ -72,6 +80,24 @@ private TargetPoolsSettings(TargetPoolsSettings existing) : base(existing) /// public gaxgrpc::CallSettings AddHealthCheckSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetPoolsClient.AddHealthCheck and + /// TargetPoolsClient.AddHealthCheckAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings AddHealthCheckOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// TargetPoolsClient.AddInstance and TargetPoolsClient.AddInstanceAsync. @@ -84,6 +110,24 @@ private TargetPoolsSettings(TargetPoolsSettings existing) : base(existing) /// public gaxgrpc::CallSettings AddInstanceSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetPoolsClient.AddInstance and + /// TargetPoolsClient.AddInstanceAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings AddInstanceOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// TargetPoolsClient.AggregatedList and TargetPoolsClient.AggregatedListAsync. @@ -108,6 +152,24 @@ private TargetPoolsSettings(TargetPoolsSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetPoolsClient.Delete and + /// TargetPoolsClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to TargetPoolsClient.Get /// and TargetPoolsClient.GetAsync. @@ -144,6 +206,24 @@ private TargetPoolsSettings(TargetPoolsSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetPoolsClient.Insert and + /// TargetPoolsClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to TargetPoolsClient.List /// and TargetPoolsClient.ListAsync. @@ -168,6 +248,24 @@ private TargetPoolsSettings(TargetPoolsSettings existing) : base(existing) /// public gaxgrpc::CallSettings RemoveHealthCheckSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetPoolsClient.RemoveHealthCheck and + /// TargetPoolsClient.RemoveHealthCheckAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings RemoveHealthCheckOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// TargetPoolsClient.RemoveInstance and TargetPoolsClient.RemoveInstanceAsync. @@ -180,6 +278,24 @@ private TargetPoolsSettings(TargetPoolsSettings existing) : base(existing) /// public gaxgrpc::CallSettings RemoveInstanceSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetPoolsClient.RemoveInstance and + /// TargetPoolsClient.RemoveInstanceAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings RemoveInstanceOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to TargetPoolsClient.SetBackup /// and TargetPoolsClient.SetBackupAsync. @@ -192,6 +308,24 @@ private TargetPoolsSettings(TargetPoolsSettings existing) : base(existing) /// public gaxgrpc::CallSettings SetBackupSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetPoolsClient.SetBackup and + /// TargetPoolsClient.SetBackupAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetBackupOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public TargetPoolsSettings Clone() => new TargetPoolsSettings(this); @@ -360,7 +494,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddHealthCheck(AddHealthCheckTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddHealthCheck(AddHealthCheckTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -369,7 +503,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddHealthCheckAsync(AddHealthCheckTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddHealthCheckAsync(AddHealthCheckTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -378,9 +512,35 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddHealthCheckAsync(AddHealthCheckTargetPoolRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddHealthCheckAsync(AddHealthCheckTargetPoolRequest request, st::CancellationToken cancellationToken) => AddHealthCheckAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for AddHealthCheck. + public virtual lro::OperationsClient AddHealthCheckOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of AddHealthCheck. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceAddHealthCheck(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddHealthCheckOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// AddHealthCheck. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceAddHealthCheckAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddHealthCheckOperationsClient, callSettings); + /// /// Adds health check URLs to a target pool. /// @@ -398,7 +558,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddHealthCheck(string project, string region, string targetPool, TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddHealthCheck(string project, string region, string targetPool, TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource, gaxgrpc::CallSettings callSettings = null) => AddHealthCheck(new AddHealthCheckTargetPoolRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -424,7 +584,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddHealthCheckAsync(string project, string region, string targetPool, TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddHealthCheckAsync(string project, string region, string targetPool, TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource, gaxgrpc::CallSettings callSettings = null) => AddHealthCheckAsync(new AddHealthCheckTargetPoolRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -450,7 +610,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddHealthCheckAsync(string project, string region, string targetPool, TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddHealthCheckAsync(string project, string region, string targetPool, TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource, st::CancellationToken cancellationToken) => AddHealthCheckAsync(project, region, targetPool, targetPoolsAddHealthCheckRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -459,7 +619,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddInstance(AddInstanceTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddInstance(AddInstanceTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -468,7 +628,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddInstanceAsync(AddInstanceTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddInstanceAsync(AddInstanceTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -477,9 +637,35 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddInstanceAsync(AddInstanceTargetPoolRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddInstanceAsync(AddInstanceTargetPoolRequest request, st::CancellationToken cancellationToken) => AddInstanceAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for AddInstance. + public virtual lro::OperationsClient AddInstanceOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of AddInstance. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceAddInstance(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddInstanceOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// AddInstance. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceAddInstanceAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), AddInstanceOperationsClient, callSettings); + /// /// Adds an instance to a target pool. /// @@ -497,7 +683,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation AddInstance(string project, string region, string targetPool, TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation AddInstance(string project, string region, string targetPool, TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource, gaxgrpc::CallSettings callSettings = null) => AddInstance(new AddInstanceTargetPoolRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -523,7 +709,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task AddInstanceAsync(string project, string region, string targetPool, TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> AddInstanceAsync(string project, string region, string targetPool, TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource, gaxgrpc::CallSettings callSettings = null) => AddInstanceAsync(new AddInstanceTargetPoolRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -549,7 +735,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task AddInstanceAsync(string project, string region, string targetPool, TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> AddInstanceAsync(string project, string region, string targetPool, TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource, st::CancellationToken cancellationToken) => AddInstanceAsync(project, region, targetPool, targetPoolsAddInstanceRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -628,7 +814,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -637,7 +823,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -646,9 +832,35 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteTargetPoolRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteTargetPoolRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified target pool. /// @@ -663,7 +875,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string targetPool, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string targetPool, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteTargetPoolRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -685,7 +897,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string targetPool, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string targetPool, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteTargetPoolRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -707,7 +919,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string targetPool, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string targetPool, st::CancellationToken cancellationToken) => DeleteAsync(project, region, targetPool, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -903,7 +1115,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -912,7 +1124,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -921,9 +1133,35 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertTargetPoolRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertTargetPoolRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a target pool in the specified project and region using the data included in the request. /// @@ -938,7 +1176,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, TargetPool targetPoolResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, TargetPool targetPoolResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertTargetPoolRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -960,7 +1198,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, TargetPool targetPoolResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, TargetPool targetPoolResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertTargetPoolRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -982,7 +1220,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, TargetPool targetPoolResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, TargetPool targetPoolResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, targetPoolResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1065,7 +1303,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RemoveHealthCheck(RemoveHealthCheckTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RemoveHealthCheck(RemoveHealthCheckTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1074,7 +1312,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RemoveHealthCheckAsync(RemoveHealthCheckTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RemoveHealthCheckAsync(RemoveHealthCheckTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1083,9 +1321,36 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RemoveHealthCheckAsync(RemoveHealthCheckTargetPoolRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> RemoveHealthCheckAsync(RemoveHealthCheckTargetPoolRequest request, st::CancellationToken cancellationToken) => RemoveHealthCheckAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for RemoveHealthCheck. + public virtual lro::OperationsClient RemoveHealthCheckOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of RemoveHealthCheck + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceRemoveHealthCheck(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RemoveHealthCheckOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// RemoveHealthCheck. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceRemoveHealthCheckAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RemoveHealthCheckOperationsClient, callSettings); + /// /// Removes health check URL from a target pool. /// @@ -1103,7 +1368,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RemoveHealthCheck(string project, string region, string targetPool, TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RemoveHealthCheck(string project, string region, string targetPool, TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource, gaxgrpc::CallSettings callSettings = null) => RemoveHealthCheck(new RemoveHealthCheckTargetPoolRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1129,7 +1394,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RemoveHealthCheckAsync(string project, string region, string targetPool, TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RemoveHealthCheckAsync(string project, string region, string targetPool, TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource, gaxgrpc::CallSettings callSettings = null) => RemoveHealthCheckAsync(new RemoveHealthCheckTargetPoolRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1155,7 +1420,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RemoveHealthCheckAsync(string project, string region, string targetPool, TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> RemoveHealthCheckAsync(string project, string region, string targetPool, TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource, st::CancellationToken cancellationToken) => RemoveHealthCheckAsync(project, region, targetPool, targetPoolsRemoveHealthCheckRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1164,7 +1429,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RemoveInstance(RemoveInstanceTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RemoveInstance(RemoveInstanceTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1173,7 +1438,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RemoveInstanceAsync(RemoveInstanceTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RemoveInstanceAsync(RemoveInstanceTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1182,9 +1447,35 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RemoveInstanceAsync(RemoveInstanceTargetPoolRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> RemoveInstanceAsync(RemoveInstanceTargetPoolRequest request, st::CancellationToken cancellationToken) => RemoveInstanceAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for RemoveInstance. + public virtual lro::OperationsClient RemoveInstanceOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of RemoveInstance. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceRemoveInstance(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RemoveInstanceOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// RemoveInstance. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceRemoveInstanceAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), RemoveInstanceOperationsClient, callSettings); + /// /// Removes instance URL from a target pool. /// @@ -1202,7 +1493,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation RemoveInstance(string project, string region, string targetPool, TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation RemoveInstance(string project, string region, string targetPool, TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource, gaxgrpc::CallSettings callSettings = null) => RemoveInstance(new RemoveInstanceTargetPoolRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1228,7 +1519,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task RemoveInstanceAsync(string project, string region, string targetPool, TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> RemoveInstanceAsync(string project, string region, string targetPool, TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource, gaxgrpc::CallSettings callSettings = null) => RemoveInstanceAsync(new RemoveInstanceTargetPoolRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1254,7 +1545,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task RemoveInstanceAsync(string project, string region, string targetPool, TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> RemoveInstanceAsync(string project, string region, string targetPool, TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource, st::CancellationToken cancellationToken) => RemoveInstanceAsync(project, region, targetPool, targetPoolsRemoveInstanceRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1263,7 +1554,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetBackup(SetBackupTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetBackup(SetBackupTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1272,7 +1563,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetBackupAsync(SetBackupTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetBackupAsync(SetBackupTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -1281,9 +1572,35 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetBackupAsync(SetBackupTargetPoolRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetBackupAsync(SetBackupTargetPoolRequest request, st::CancellationToken cancellationToken) => SetBackupAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetBackup. + public virtual lro::OperationsClient SetBackupOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetBackup. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetBackup(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetBackupOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetBackup. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetBackupAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetBackupOperationsClient, callSettings); + /// /// Changes a backup target pool's configurations. /// @@ -1301,7 +1618,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetBackup(string project, string region, string targetPool, TargetReference targetReferenceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetBackup(string project, string region, string targetPool, TargetReference targetReferenceResource, gaxgrpc::CallSettings callSettings = null) => SetBackup(new SetBackupTargetPoolRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1327,7 +1644,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetBackupAsync(string project, string region, string targetPool, TargetReference targetReferenceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetBackupAsync(string project, string region, string targetPool, TargetReference targetReferenceResource, gaxgrpc::CallSettings callSettings = null) => SetBackupAsync(new SetBackupTargetPoolRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -1353,7 +1670,7 @@ internal static TargetPoolsClient Create(grpccore::CallInvoker callInvoker, Targ /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetBackupAsync(string project, string region, string targetPool, TargetReference targetReferenceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetBackupAsync(string project, string region, string targetPool, TargetReference targetReferenceResource, st::CancellationToken cancellationToken) => SetBackupAsync(project, region, targetPool, targetReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -1395,6 +1712,13 @@ public TargetPoolsClientImpl(TargetPools.TargetPoolsClient grpcClient, TargetPoo GrpcClient = grpcClient; TargetPoolsSettings effectiveSettings = settings ?? TargetPoolsSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + AddHealthCheckOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.AddHealthCheckOperationsSettings); + AddInstanceOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.AddInstanceOperationsSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); + RemoveHealthCheckOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.RemoveHealthCheckOperationsSettings); + RemoveInstanceOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.RemoveInstanceOperationsSettings); + SetBackupOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.SetBackupOperationsSettings); _callAddHealthCheck = clientHelper.BuildApiCall(grpcClient.AddHealthCheckAsync, grpcClient.AddHealthCheck, effectiveSettings.AddHealthCheckSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("region", request => request.Region).WithGoogleRequestParam("target_pool", request => request.TargetPool); Modify_ApiCall(ref _callAddHealthCheck); Modify_AddHealthCheckApiCall(ref _callAddHealthCheck); @@ -1482,16 +1806,22 @@ public TargetPoolsClientImpl(TargetPools.TargetPoolsClient grpcClient, TargetPoo partial void Modify_SetBackupTargetPoolRequest(ref SetBackupTargetPoolRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for AddHealthCheck. + public override lro::OperationsClient AddHealthCheckOperationsClient { get; } + /// /// Adds health check URLs to a target pool. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation AddHealthCheck(AddHealthCheckTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation AddHealthCheck(AddHealthCheckTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddHealthCheckTargetPoolRequest(ref request, ref callSettings); - return _callAddHealthCheck.Sync(request, callSettings); + Operation response = _callAddHealthCheck.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddHealthCheckOperationsClient); } /// @@ -1500,22 +1830,31 @@ public override Operation AddHealthCheck(AddHealthCheckTargetPoolRequest request /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task AddHealthCheckAsync(AddHealthCheckTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> AddHealthCheckAsync(AddHealthCheckTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddHealthCheckTargetPoolRequest(ref request, ref callSettings); - return _callAddHealthCheck.Async(request, callSettings); + Operation response = await _callAddHealthCheck.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddHealthCheckOperationsClient); } + /// The long-running operations client for AddInstance. + public override lro::OperationsClient AddInstanceOperationsClient { get; } + /// /// Adds an instance to a target pool. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation AddInstance(AddInstanceTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation AddInstance(AddInstanceTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddInstanceTargetPoolRequest(ref request, ref callSettings); - return _callAddInstance.Sync(request, callSettings); + Operation response = _callAddInstance.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddInstanceOperationsClient); } /// @@ -1524,10 +1863,13 @@ public override Operation AddInstance(AddInstanceTargetPoolRequest request, gaxg /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task AddInstanceAsync(AddInstanceTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> AddInstanceAsync(AddInstanceTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_AddInstanceTargetPoolRequest(ref request, ref callSettings); - return _callAddInstance.Async(request, callSettings); + Operation response = await _callAddInstance.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), AddInstanceOperationsClient); } /// @@ -1556,16 +1898,22 @@ public override Operation AddInstance(AddInstanceTargetPoolRequest request, gaxg return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified target pool. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteTargetPoolRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1574,10 +1922,13 @@ public override Operation Delete(DeleteTargetPoolRequest request, gaxgrpc::CallS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteTargetPoolRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1628,16 +1979,22 @@ public override TargetPoolInstanceHealth GetHealth(GetHealthTargetPoolRequest re return _callGetHealth.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a target pool in the specified project and region using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertTargetPoolRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1646,10 +2003,13 @@ public override Operation Insert(InsertTargetPoolRequest request, gaxgrpc::CallS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertTargetPoolRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1676,16 +2036,22 @@ public override Operation Insert(InsertTargetPoolRequest request, gaxgrpc::CallS return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for RemoveHealthCheck. + public override lro::OperationsClient RemoveHealthCheckOperationsClient { get; } + /// /// Removes health check URL from a target pool. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation RemoveHealthCheck(RemoveHealthCheckTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation RemoveHealthCheck(RemoveHealthCheckTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RemoveHealthCheckTargetPoolRequest(ref request, ref callSettings); - return _callRemoveHealthCheck.Sync(request, callSettings); + Operation response = _callRemoveHealthCheck.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RemoveHealthCheckOperationsClient); } /// @@ -1694,22 +2060,31 @@ public override Operation RemoveHealthCheck(RemoveHealthCheckTargetPoolRequest r /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task RemoveHealthCheckAsync(RemoveHealthCheckTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> RemoveHealthCheckAsync(RemoveHealthCheckTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RemoveHealthCheckTargetPoolRequest(ref request, ref callSettings); - return _callRemoveHealthCheck.Async(request, callSettings); + Operation response = await _callRemoveHealthCheck.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RemoveHealthCheckOperationsClient); } + /// The long-running operations client for RemoveInstance. + public override lro::OperationsClient RemoveInstanceOperationsClient { get; } + /// /// Removes instance URL from a target pool. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation RemoveInstance(RemoveInstanceTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation RemoveInstance(RemoveInstanceTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RemoveInstanceTargetPoolRequest(ref request, ref callSettings); - return _callRemoveInstance.Sync(request, callSettings); + Operation response = _callRemoveInstance.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RemoveInstanceOperationsClient); } /// @@ -1718,22 +2093,31 @@ public override Operation RemoveInstance(RemoveInstanceTargetPoolRequest request /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task RemoveInstanceAsync(RemoveInstanceTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> RemoveInstanceAsync(RemoveInstanceTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_RemoveInstanceTargetPoolRequest(ref request, ref callSettings); - return _callRemoveInstance.Async(request, callSettings); + Operation response = await _callRemoveInstance.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), RemoveInstanceOperationsClient); } + /// The long-running operations client for SetBackup. + public override lro::OperationsClient SetBackupOperationsClient { get; } + /// /// Changes a backup target pool's configurations. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetBackup(SetBackupTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetBackup(SetBackupTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetBackupTargetPoolRequest(ref request, ref callSettings); - return _callSetBackup.Sync(request, callSettings); + Operation response = _callSetBackup.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetBackupOperationsClient); } /// @@ -1742,10 +2126,13 @@ public override Operation SetBackup(SetBackupTargetPoolRequest request, gaxgrpc: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetBackupAsync(SetBackupTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetBackupAsync(SetBackupTargetPoolRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetBackupTargetPoolRequest(ref request, ref callSettings); - return _callSetBackup.Async(request, callSettings); + Operation response = await _callSetBackup.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetBackupOperationsClient); } } @@ -1784,4 +2171,18 @@ public partial class TargetPoolList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class TargetPools + { + public partial class TargetPoolsClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetSslProxiesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetSslProxiesClient.g.cs index 5ba6aae67898..4d962f8f8fa2 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetSslProxiesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetSslProxiesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,13 +46,19 @@ private TargetSslProxiesSettings(TargetSslProxiesSettings existing) : base(exist { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; SetBackendServiceSettings = existing.SetBackendServiceSettings; + SetBackendServiceOperationsSettings = existing.SetBackendServiceOperationsSettings.Clone(); SetProxyHeaderSettings = existing.SetProxyHeaderSettings; + SetProxyHeaderOperationsSettings = existing.SetProxyHeaderOperationsSettings.Clone(); SetSslCertificatesSettings = existing.SetSslCertificatesSettings; + SetSslCertificatesOperationsSettings = existing.SetSslCertificatesOperationsSettings.Clone(); SetSslPolicySettings = existing.SetSslPolicySettings; + SetSslPolicyOperationsSettings = existing.SetSslPolicyOperationsSettings.Clone(); OnCopy(existing); } @@ -69,6 +76,24 @@ private TargetSslProxiesSettings(TargetSslProxiesSettings existing) : base(exist /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetSslProxiesClient.Delete and + /// TargetSslProxiesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to TargetSslProxiesClient.Get /// and TargetSslProxiesClient.GetAsync. @@ -93,6 +118,24 @@ private TargetSslProxiesSettings(TargetSslProxiesSettings existing) : base(exist /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetSslProxiesClient.Insert and + /// TargetSslProxiesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to TargetSslProxiesClient.List /// and TargetSslProxiesClient.ListAsync. @@ -117,6 +160,24 @@ private TargetSslProxiesSettings(TargetSslProxiesSettings existing) : base(exist /// public gaxgrpc::CallSettings SetBackendServiceSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetSslProxiesClient.SetBackendService and + /// TargetSslProxiesClient.SetBackendServiceAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetBackendServiceOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// TargetSslProxiesClient.SetProxyHeader and TargetSslProxiesClient.SetProxyHeaderAsync. @@ -129,6 +190,24 @@ private TargetSslProxiesSettings(TargetSslProxiesSettings existing) : base(exist /// public gaxgrpc::CallSettings SetProxyHeaderSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetSslProxiesClient.SetProxyHeader and + /// TargetSslProxiesClient.SetProxyHeaderAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetProxyHeaderOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// TargetSslProxiesClient.SetSslCertificates and TargetSslProxiesClient.SetSslCertificatesAsync. @@ -141,6 +220,24 @@ private TargetSslProxiesSettings(TargetSslProxiesSettings existing) : base(exist /// public gaxgrpc::CallSettings SetSslCertificatesSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetSslProxiesClient.SetSslCertificates and + /// TargetSslProxiesClient.SetSslCertificatesAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetSslCertificatesOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// TargetSslProxiesClient.SetSslPolicy and TargetSslProxiesClient.SetSslPolicyAsync. @@ -153,6 +250,24 @@ private TargetSslProxiesSettings(TargetSslProxiesSettings existing) : base(exist /// public gaxgrpc::CallSettings SetSslPolicySettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetSslProxiesClient.SetSslPolicy and + /// TargetSslProxiesClient.SetSslPolicyAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetSslPolicyOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public TargetSslProxiesSettings Clone() => new TargetSslProxiesSettings(this); @@ -322,7 +437,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -331,7 +446,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -340,9 +455,35 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteTargetSslProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteTargetSslProxyRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified TargetSslProxy resource. /// @@ -354,7 +495,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string targetSslProxy, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string targetSslProxy, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteTargetSslProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -372,7 +513,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string targetSslProxy, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string targetSslProxy, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteTargetSslProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -390,7 +531,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string targetSslProxy, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string targetSslProxy, st::CancellationToken cancellationToken) => DeleteAsync(project, targetSslProxy, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -476,7 +617,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -485,7 +626,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -494,9 +635,35 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertTargetSslProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertTargetSslProxyRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a TargetSslProxy resource in the specified project using the data included in the request. /// @@ -508,7 +675,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, TargetSslProxy targetSslProxyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, TargetSslProxy targetSslProxyResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertTargetSslProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -526,7 +693,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, TargetSslProxy targetSslProxyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, TargetSslProxy targetSslProxyResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertTargetSslProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -544,7 +711,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, TargetSslProxy targetSslProxyResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, TargetSslProxy targetSslProxyResource, st::CancellationToken cancellationToken) => InsertAsync(project, targetSslProxyResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -619,7 +786,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetBackendService(SetBackendServiceTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetBackendService(SetBackendServiceTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -628,7 +795,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetBackendServiceAsync(SetBackendServiceTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetBackendServiceAsync(SetBackendServiceTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -637,9 +804,36 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetBackendServiceAsync(SetBackendServiceTargetSslProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetBackendServiceAsync(SetBackendServiceTargetSslProxyRequest request, st::CancellationToken cancellationToken) => SetBackendServiceAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetBackendService. + public virtual lro::OperationsClient SetBackendServiceOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetBackendService + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetBackendService(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetBackendServiceOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetBackendService. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetBackendServiceAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetBackendServiceOperationsClient, callSettings); + /// /// Changes the BackendService for TargetSslProxy. /// @@ -654,7 +848,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetBackendService(string project, string targetSslProxy, TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetBackendService(string project, string targetSslProxy, TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource, gaxgrpc::CallSettings callSettings = null) => SetBackendService(new SetBackendServiceTargetSslProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -676,7 +870,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetBackendServiceAsync(string project, string targetSslProxy, TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetBackendServiceAsync(string project, string targetSslProxy, TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource, gaxgrpc::CallSettings callSettings = null) => SetBackendServiceAsync(new SetBackendServiceTargetSslProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -698,7 +892,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetBackendServiceAsync(string project, string targetSslProxy, TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetBackendServiceAsync(string project, string targetSslProxy, TargetSslProxiesSetBackendServiceRequest targetSslProxiesSetBackendServiceRequestResource, st::CancellationToken cancellationToken) => SetBackendServiceAsync(project, targetSslProxy, targetSslProxiesSetBackendServiceRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -707,7 +901,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetProxyHeader(SetProxyHeaderTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetProxyHeader(SetProxyHeaderTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -716,7 +910,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetProxyHeaderAsync(SetProxyHeaderTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetProxyHeaderAsync(SetProxyHeaderTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -725,9 +919,35 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetProxyHeaderAsync(SetProxyHeaderTargetSslProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetProxyHeaderAsync(SetProxyHeaderTargetSslProxyRequest request, st::CancellationToken cancellationToken) => SetProxyHeaderAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetProxyHeader. + public virtual lro::OperationsClient SetProxyHeaderOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetProxyHeader. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetProxyHeader(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetProxyHeaderOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetProxyHeader. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetProxyHeaderAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetProxyHeaderOperationsClient, callSettings); + /// /// Changes the ProxyHeaderType for TargetSslProxy. /// @@ -742,7 +962,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetProxyHeader(string project, string targetSslProxy, TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetProxyHeader(string project, string targetSslProxy, TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource, gaxgrpc::CallSettings callSettings = null) => SetProxyHeader(new SetProxyHeaderTargetSslProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -764,7 +984,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetProxyHeaderAsync(string project, string targetSslProxy, TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetProxyHeaderAsync(string project, string targetSslProxy, TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource, gaxgrpc::CallSettings callSettings = null) => SetProxyHeaderAsync(new SetProxyHeaderTargetSslProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -786,7 +1006,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetProxyHeaderAsync(string project, string targetSslProxy, TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetProxyHeaderAsync(string project, string targetSslProxy, TargetSslProxiesSetProxyHeaderRequest targetSslProxiesSetProxyHeaderRequestResource, st::CancellationToken cancellationToken) => SetProxyHeaderAsync(project, targetSslProxy, targetSslProxiesSetProxyHeaderRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -795,7 +1015,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetSslCertificates(SetSslCertificatesTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetSslCertificates(SetSslCertificatesTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -804,7 +1024,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetSslCertificatesAsync(SetSslCertificatesTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetSslCertificatesAsync(SetSslCertificatesTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -813,9 +1033,36 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetSslCertificatesAsync(SetSslCertificatesTargetSslProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetSslCertificatesAsync(SetSslCertificatesTargetSslProxyRequest request, st::CancellationToken cancellationToken) => SetSslCertificatesAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetSslCertificates. + public virtual lro::OperationsClient SetSslCertificatesOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetSslCertificates + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetSslCertificates(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetSslCertificatesOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetSslCertificates. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetSslCertificatesAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetSslCertificatesOperationsClient, callSettings); + /// /// Changes SslCertificates for TargetSslProxy. /// @@ -830,7 +1077,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetSslCertificates(string project, string targetSslProxy, TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetSslCertificates(string project, string targetSslProxy, TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource, gaxgrpc::CallSettings callSettings = null) => SetSslCertificates(new SetSslCertificatesTargetSslProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -852,7 +1099,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetSslCertificatesAsync(string project, string targetSslProxy, TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetSslCertificatesAsync(string project, string targetSslProxy, TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource, gaxgrpc::CallSettings callSettings = null) => SetSslCertificatesAsync(new SetSslCertificatesTargetSslProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -874,7 +1121,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetSslCertificatesAsync(string project, string targetSslProxy, TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetSslCertificatesAsync(string project, string targetSslProxy, TargetSslProxiesSetSslCertificatesRequest targetSslProxiesSetSslCertificatesRequestResource, st::CancellationToken cancellationToken) => SetSslCertificatesAsync(project, targetSslProxy, targetSslProxiesSetSslCertificatesRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -883,7 +1130,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetSslPolicy(SetSslPolicyTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetSslPolicy(SetSslPolicyTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -892,7 +1139,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetSslPolicyAsync(SetSslPolicyTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetSslPolicyAsync(SetSslPolicyTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -901,9 +1148,35 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetSslPolicyAsync(SetSslPolicyTargetSslProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetSslPolicyAsync(SetSslPolicyTargetSslProxyRequest request, st::CancellationToken cancellationToken) => SetSslPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetSslPolicy. + public virtual lro::OperationsClient SetSslPolicyOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetSslPolicy. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetSslPolicy(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetSslPolicyOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetSslPolicy. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetSslPolicyAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetSslPolicyOperationsClient, callSettings); + /// /// Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the SSL proxy load balancer. They do not affect the connection between the load balancer and the backends. /// @@ -918,7 +1191,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetSslPolicy(string project, string targetSslProxy, SslPolicyReference sslPolicyReferenceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetSslPolicy(string project, string targetSslProxy, SslPolicyReference sslPolicyReferenceResource, gaxgrpc::CallSettings callSettings = null) => SetSslPolicy(new SetSslPolicyTargetSslProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -940,7 +1213,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetSslPolicyAsync(string project, string targetSslProxy, SslPolicyReference sslPolicyReferenceResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetSslPolicyAsync(string project, string targetSslProxy, SslPolicyReference sslPolicyReferenceResource, gaxgrpc::CallSettings callSettings = null) => SetSslPolicyAsync(new SetSslPolicyTargetSslProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -962,7 +1235,7 @@ internal static TargetSslProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetSslPolicyAsync(string project, string targetSslProxy, SslPolicyReference sslPolicyReferenceResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetSslPolicyAsync(string project, string targetSslProxy, SslPolicyReference sslPolicyReferenceResource, st::CancellationToken cancellationToken) => SetSslPolicyAsync(project, targetSslProxy, sslPolicyReferenceResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -998,6 +1271,12 @@ public TargetSslProxiesClientImpl(TargetSslProxies.TargetSslProxiesClient grpcCl GrpcClient = grpcClient; TargetSslProxiesSettings effectiveSettings = settings ?? TargetSslProxiesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); + SetBackendServiceOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.SetBackendServiceOperationsSettings); + SetProxyHeaderOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.SetProxyHeaderOperationsSettings); + SetSslCertificatesOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.SetSslCertificatesOperationsSettings); + SetSslPolicyOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.SetSslPolicyOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("target_ssl_proxy", request => request.TargetSslProxy); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -1064,16 +1343,22 @@ public TargetSslProxiesClientImpl(TargetSslProxies.TargetSslProxiesClient grpcCl partial void Modify_SetSslPolicyTargetSslProxyRequest(ref SetSslPolicyTargetSslProxyRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified TargetSslProxy resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteTargetSslProxyRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1082,10 +1367,13 @@ public override Operation Delete(DeleteTargetSslProxyRequest request, gaxgrpc::C /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteTargetSslProxyRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1112,16 +1400,22 @@ public override TargetSslProxy Get(GetTargetSslProxyRequest request, gaxgrpc::Ca return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a TargetSslProxy resource in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertTargetSslProxyRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1130,10 +1424,13 @@ public override Operation Insert(InsertTargetSslProxyRequest request, gaxgrpc::C /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertTargetSslProxyRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1160,16 +1457,22 @@ public override Operation Insert(InsertTargetSslProxyRequest request, gaxgrpc::C return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for SetBackendService. + public override lro::OperationsClient SetBackendServiceOperationsClient { get; } + /// /// Changes the BackendService for TargetSslProxy. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetBackendService(SetBackendServiceTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetBackendService(SetBackendServiceTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetBackendServiceTargetSslProxyRequest(ref request, ref callSettings); - return _callSetBackendService.Sync(request, callSettings); + Operation response = _callSetBackendService.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetBackendServiceOperationsClient); } /// @@ -1178,22 +1481,31 @@ public override Operation SetBackendService(SetBackendServiceTargetSslProxyReque /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetBackendServiceAsync(SetBackendServiceTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetBackendServiceAsync(SetBackendServiceTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetBackendServiceTargetSslProxyRequest(ref request, ref callSettings); - return _callSetBackendService.Async(request, callSettings); + Operation response = await _callSetBackendService.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetBackendServiceOperationsClient); } + /// The long-running operations client for SetProxyHeader. + public override lro::OperationsClient SetProxyHeaderOperationsClient { get; } + /// /// Changes the ProxyHeaderType for TargetSslProxy. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetProxyHeader(SetProxyHeaderTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetProxyHeader(SetProxyHeaderTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetProxyHeaderTargetSslProxyRequest(ref request, ref callSettings); - return _callSetProxyHeader.Sync(request, callSettings); + Operation response = _callSetProxyHeader.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetProxyHeaderOperationsClient); } /// @@ -1202,22 +1514,31 @@ public override Operation SetProxyHeader(SetProxyHeaderTargetSslProxyRequest req /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetProxyHeaderAsync(SetProxyHeaderTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetProxyHeaderAsync(SetProxyHeaderTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetProxyHeaderTargetSslProxyRequest(ref request, ref callSettings); - return _callSetProxyHeader.Async(request, callSettings); + Operation response = await _callSetProxyHeader.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetProxyHeaderOperationsClient); } + /// The long-running operations client for SetSslCertificates. + public override lro::OperationsClient SetSslCertificatesOperationsClient { get; } + /// /// Changes SslCertificates for TargetSslProxy. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetSslCertificates(SetSslCertificatesTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetSslCertificates(SetSslCertificatesTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetSslCertificatesTargetSslProxyRequest(ref request, ref callSettings); - return _callSetSslCertificates.Sync(request, callSettings); + Operation response = _callSetSslCertificates.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetSslCertificatesOperationsClient); } /// @@ -1226,22 +1547,31 @@ public override Operation SetSslCertificates(SetSslCertificatesTargetSslProxyReq /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetSslCertificatesAsync(SetSslCertificatesTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetSslCertificatesAsync(SetSslCertificatesTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetSslCertificatesTargetSslProxyRequest(ref request, ref callSettings); - return _callSetSslCertificates.Async(request, callSettings); + Operation response = await _callSetSslCertificates.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetSslCertificatesOperationsClient); } + /// The long-running operations client for SetSslPolicy. + public override lro::OperationsClient SetSslPolicyOperationsClient { get; } + /// /// Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the SSL proxy load balancer. They do not affect the connection between the load balancer and the backends. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetSslPolicy(SetSslPolicyTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetSslPolicy(SetSslPolicyTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetSslPolicyTargetSslProxyRequest(ref request, ref callSettings); - return _callSetSslPolicy.Sync(request, callSettings); + Operation response = _callSetSslPolicy.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetSslPolicyOperationsClient); } /// @@ -1250,10 +1580,13 @@ public override Operation SetSslPolicy(SetSslPolicyTargetSslProxyRequest request /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetSslPolicyAsync(SetSslPolicyTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetSslPolicyAsync(SetSslPolicyTargetSslProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetSslPolicyTargetSslProxyRequest(ref request, ref callSettings); - return _callSetSslPolicy.Async(request, callSettings); + Operation response = await _callSetSslPolicy.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetSslPolicyOperationsClient); } } @@ -1274,4 +1607,18 @@ public partial class TargetSslProxyList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class TargetSslProxies + { + public partial class TargetSslProxiesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetTcpProxiesClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetTcpProxiesClient.g.cs index 8a46fbace0ff..cfc220ca63bb 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetTcpProxiesClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetTcpProxiesClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -45,11 +46,15 @@ private TargetTcpProxiesSettings(TargetTcpProxiesSettings existing) : base(exist { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; SetBackendServiceSettings = existing.SetBackendServiceSettings; + SetBackendServiceOperationsSettings = existing.SetBackendServiceOperationsSettings.Clone(); SetProxyHeaderSettings = existing.SetProxyHeaderSettings; + SetProxyHeaderOperationsSettings = existing.SetProxyHeaderOperationsSettings.Clone(); OnCopy(existing); } @@ -67,6 +72,24 @@ private TargetTcpProxiesSettings(TargetTcpProxiesSettings existing) : base(exist /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetTcpProxiesClient.Delete and + /// TargetTcpProxiesClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to TargetTcpProxiesClient.Get /// and TargetTcpProxiesClient.GetAsync. @@ -91,6 +114,24 @@ private TargetTcpProxiesSettings(TargetTcpProxiesSettings existing) : base(exist /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetTcpProxiesClient.Insert and + /// TargetTcpProxiesClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to TargetTcpProxiesClient.List /// and TargetTcpProxiesClient.ListAsync. @@ -115,6 +156,24 @@ private TargetTcpProxiesSettings(TargetTcpProxiesSettings existing) : base(exist /// public gaxgrpc::CallSettings SetBackendServiceSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetTcpProxiesClient.SetBackendService and + /// TargetTcpProxiesClient.SetBackendServiceAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetBackendServiceOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// TargetTcpProxiesClient.SetProxyHeader and TargetTcpProxiesClient.SetProxyHeaderAsync. @@ -127,6 +186,24 @@ private TargetTcpProxiesSettings(TargetTcpProxiesSettings existing) : base(exist /// public gaxgrpc::CallSettings SetProxyHeaderSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetTcpProxiesClient.SetProxyHeader and + /// TargetTcpProxiesClient.SetProxyHeaderAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetProxyHeaderOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// Creates a deep clone of this object, with all the same property values. /// A deep clone of this object. public TargetTcpProxiesSettings Clone() => new TargetTcpProxiesSettings(this); @@ -296,7 +373,7 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -305,7 +382,7 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -314,9 +391,35 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteTargetTcpProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteTargetTcpProxyRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified TargetTcpProxy resource. /// @@ -328,7 +431,7 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string targetTcpProxy, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string targetTcpProxy, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteTargetTcpProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -346,7 +449,7 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string targetTcpProxy, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string targetTcpProxy, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteTargetTcpProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -364,7 +467,7 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string targetTcpProxy, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string targetTcpProxy, st::CancellationToken cancellationToken) => DeleteAsync(project, targetTcpProxy, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -450,7 +553,7 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -459,7 +562,7 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -468,9 +571,35 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertTargetTcpProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertTargetTcpProxyRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a TargetTcpProxy resource in the specified project using the data included in the request. /// @@ -482,7 +611,7 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, TargetTcpProxy targetTcpProxyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, TargetTcpProxy targetTcpProxyResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertTargetTcpProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -500,7 +629,7 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, TargetTcpProxy targetTcpProxyResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, TargetTcpProxy targetTcpProxyResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertTargetTcpProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -518,7 +647,7 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, TargetTcpProxy targetTcpProxyResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, TargetTcpProxy targetTcpProxyResource, st::CancellationToken cancellationToken) => InsertAsync(project, targetTcpProxyResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -593,7 +722,7 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetBackendService(SetBackendServiceTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetBackendService(SetBackendServiceTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -602,7 +731,7 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetBackendServiceAsync(SetBackendServiceTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetBackendServiceAsync(SetBackendServiceTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -611,9 +740,36 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetBackendServiceAsync(SetBackendServiceTargetTcpProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetBackendServiceAsync(SetBackendServiceTargetTcpProxyRequest request, st::CancellationToken cancellationToken) => SetBackendServiceAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetBackendService. + public virtual lro::OperationsClient SetBackendServiceOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetBackendService + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetBackendService(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetBackendServiceOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetBackendService. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetBackendServiceAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetBackendServiceOperationsClient, callSettings); + /// /// Changes the BackendService for TargetTcpProxy. /// @@ -628,7 +784,7 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetBackendService(string project, string targetTcpProxy, TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetBackendService(string project, string targetTcpProxy, TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource, gaxgrpc::CallSettings callSettings = null) => SetBackendService(new SetBackendServiceTargetTcpProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -650,7 +806,7 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetBackendServiceAsync(string project, string targetTcpProxy, TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetBackendServiceAsync(string project, string targetTcpProxy, TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource, gaxgrpc::CallSettings callSettings = null) => SetBackendServiceAsync(new SetBackendServiceTargetTcpProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -672,7 +828,7 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetBackendServiceAsync(string project, string targetTcpProxy, TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetBackendServiceAsync(string project, string targetTcpProxy, TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource, st::CancellationToken cancellationToken) => SetBackendServiceAsync(project, targetTcpProxy, targetTcpProxiesSetBackendServiceRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -681,7 +837,7 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetProxyHeader(SetProxyHeaderTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetProxyHeader(SetProxyHeaderTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -690,7 +846,7 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetProxyHeaderAsync(SetProxyHeaderTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetProxyHeaderAsync(SetProxyHeaderTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -699,9 +855,35 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetProxyHeaderAsync(SetProxyHeaderTargetTcpProxyRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetProxyHeaderAsync(SetProxyHeaderTargetTcpProxyRequest request, st::CancellationToken cancellationToken) => SetProxyHeaderAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetProxyHeader. + public virtual lro::OperationsClient SetProxyHeaderOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetProxyHeader. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetProxyHeader(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetProxyHeaderOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetProxyHeader. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetProxyHeaderAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetProxyHeaderOperationsClient, callSettings); + /// /// Changes the ProxyHeaderType for TargetTcpProxy. /// @@ -716,7 +898,7 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetProxyHeader(string project, string targetTcpProxy, TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetProxyHeader(string project, string targetTcpProxy, TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource, gaxgrpc::CallSettings callSettings = null) => SetProxyHeader(new SetProxyHeaderTargetTcpProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -738,7 +920,7 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetProxyHeaderAsync(string project, string targetTcpProxy, TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetProxyHeaderAsync(string project, string targetTcpProxy, TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource, gaxgrpc::CallSettings callSettings = null) => SetProxyHeaderAsync(new SetProxyHeaderTargetTcpProxyRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -760,7 +942,7 @@ internal static TargetTcpProxiesClient Create(grpccore::CallInvoker callInvoker, /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetProxyHeaderAsync(string project, string targetTcpProxy, TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetProxyHeaderAsync(string project, string targetTcpProxy, TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource, st::CancellationToken cancellationToken) => SetProxyHeaderAsync(project, targetTcpProxy, targetTcpProxiesSetProxyHeaderRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); } @@ -792,6 +974,10 @@ public TargetTcpProxiesClientImpl(TargetTcpProxies.TargetTcpProxiesClient grpcCl GrpcClient = grpcClient; TargetTcpProxiesSettings effectiveSettings = settings ?? TargetTcpProxiesSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); + SetBackendServiceOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.SetBackendServiceOperationsSettings); + SetProxyHeaderOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.SetProxyHeaderOperationsSettings); _callDelete = clientHelper.BuildApiCall(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("target_tcp_proxy", request => request.TargetTcpProxy); Modify_ApiCall(ref _callDelete); Modify_DeleteApiCall(ref _callDelete); @@ -844,16 +1030,22 @@ public TargetTcpProxiesClientImpl(TargetTcpProxies.TargetTcpProxiesClient grpcCl partial void Modify_SetProxyHeaderTargetTcpProxyRequest(ref SetProxyHeaderTargetTcpProxyRequest request, ref gaxgrpc::CallSettings settings); + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified TargetTcpProxy resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteTargetTcpProxyRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -862,10 +1054,13 @@ public override Operation Delete(DeleteTargetTcpProxyRequest request, gaxgrpc::C /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteTargetTcpProxyRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -892,16 +1087,22 @@ public override TargetTcpProxy Get(GetTargetTcpProxyRequest request, gaxgrpc::Ca return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a TargetTcpProxy resource in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertTargetTcpProxyRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -910,10 +1111,13 @@ public override Operation Insert(InsertTargetTcpProxyRequest request, gaxgrpc::C /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertTargetTcpProxyRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -940,16 +1144,22 @@ public override Operation Insert(InsertTargetTcpProxyRequest request, gaxgrpc::C return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for SetBackendService. + public override lro::OperationsClient SetBackendServiceOperationsClient { get; } + /// /// Changes the BackendService for TargetTcpProxy. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetBackendService(SetBackendServiceTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetBackendService(SetBackendServiceTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetBackendServiceTargetTcpProxyRequest(ref request, ref callSettings); - return _callSetBackendService.Sync(request, callSettings); + Operation response = _callSetBackendService.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetBackendServiceOperationsClient); } /// @@ -958,22 +1168,31 @@ public override Operation SetBackendService(SetBackendServiceTargetTcpProxyReque /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetBackendServiceAsync(SetBackendServiceTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetBackendServiceAsync(SetBackendServiceTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetBackendServiceTargetTcpProxyRequest(ref request, ref callSettings); - return _callSetBackendService.Async(request, callSettings); + Operation response = await _callSetBackendService.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetBackendServiceOperationsClient); } + /// The long-running operations client for SetProxyHeader. + public override lro::OperationsClient SetProxyHeaderOperationsClient { get; } + /// /// Changes the ProxyHeaderType for TargetTcpProxy. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetProxyHeader(SetProxyHeaderTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetProxyHeader(SetProxyHeaderTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetProxyHeaderTargetTcpProxyRequest(ref request, ref callSettings); - return _callSetProxyHeader.Sync(request, callSettings); + Operation response = _callSetProxyHeader.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetProxyHeaderOperationsClient); } /// @@ -982,10 +1201,13 @@ public override Operation SetProxyHeader(SetProxyHeaderTargetTcpProxyRequest req /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetProxyHeaderAsync(SetProxyHeaderTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetProxyHeaderAsync(SetProxyHeaderTargetTcpProxyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetProxyHeaderTargetTcpProxyRequest(ref request, ref callSettings); - return _callSetProxyHeader.Async(request, callSettings); + Operation response = await _callSetProxyHeader.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetProxyHeaderOperationsClient); } } @@ -1006,4 +1228,18 @@ public partial class TargetTcpProxyList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class TargetTcpProxies + { + public partial class TargetTcpProxiesClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetVpnGatewaysClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetVpnGatewaysClient.g.cs index f53f41445d19..5fa435f5ea2e 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetVpnGatewaysClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/TargetVpnGatewaysClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -46,8 +47,10 @@ private TargetVpnGatewaysSettings(TargetVpnGatewaysSettings existing) : base(exi gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; OnCopy(existing); } @@ -78,6 +81,24 @@ private TargetVpnGatewaysSettings(TargetVpnGatewaysSettings existing) : base(exi /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetVpnGatewaysClient.Delete and + /// TargetVpnGatewaysClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to TargetVpnGatewaysClient.Get /// and TargetVpnGatewaysClient.GetAsync. @@ -102,6 +123,24 @@ private TargetVpnGatewaysSettings(TargetVpnGatewaysSettings existing) : base(exi /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to TargetVpnGatewaysClient.Insert and + /// TargetVpnGatewaysClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// TargetVpnGatewaysClient.List and TargetVpnGatewaysClient.ListAsync. @@ -353,7 +392,7 @@ internal static TargetVpnGatewaysClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteTargetVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteTargetVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -362,7 +401,7 @@ internal static TargetVpnGatewaysClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteTargetVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteTargetVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -371,9 +410,35 @@ internal static TargetVpnGatewaysClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteTargetVpnGatewayRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteTargetVpnGatewayRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified target VPN gateway. /// @@ -388,7 +453,7 @@ internal static TargetVpnGatewaysClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string targetVpnGateway, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string targetVpnGateway, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteTargetVpnGatewayRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -410,7 +475,7 @@ internal static TargetVpnGatewaysClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string targetVpnGateway, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string targetVpnGateway, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteTargetVpnGatewayRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -432,7 +497,7 @@ internal static TargetVpnGatewaysClient Create(grpccore::CallInvoker callInvoker /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string targetVpnGateway, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string targetVpnGateway, st::CancellationToken cancellationToken) => DeleteAsync(project, region, targetVpnGateway, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -529,7 +594,7 @@ internal static TargetVpnGatewaysClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertTargetVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertTargetVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -538,7 +603,7 @@ internal static TargetVpnGatewaysClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertTargetVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertTargetVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -547,9 +612,35 @@ internal static TargetVpnGatewaysClient Create(grpccore::CallInvoker callInvoker /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertTargetVpnGatewayRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertTargetVpnGatewayRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a target VPN gateway in the specified project and region using the data included in the request. /// @@ -564,7 +655,7 @@ internal static TargetVpnGatewaysClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, TargetVpnGateway targetVpnGatewayResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, TargetVpnGateway targetVpnGatewayResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertTargetVpnGatewayRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -586,7 +677,7 @@ internal static TargetVpnGatewaysClient Create(grpccore::CallInvoker callInvoker /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, TargetVpnGateway targetVpnGatewayResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, TargetVpnGateway targetVpnGatewayResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertTargetVpnGatewayRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -608,7 +699,7 @@ internal static TargetVpnGatewaysClient Create(grpccore::CallInvoker callInvoker /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, TargetVpnGateway targetVpnGatewayResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, TargetVpnGateway targetVpnGatewayResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, targetVpnGatewayResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -712,6 +803,8 @@ public TargetVpnGatewaysClientImpl(TargetVpnGateways.TargetVpnGatewaysClient grp GrpcClient = grpcClient; TargetVpnGatewaysSettings effectiveSettings = settings ?? TargetVpnGatewaysSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); _callAggregatedList = clientHelper.BuildApiCall(grpcClient.AggregatedListAsync, grpcClient.AggregatedList, effectiveSettings.AggregatedListSettings).WithGoogleRequestParam("project", request => request.Project); Modify_ApiCall(ref _callAggregatedList); Modify_AggregatedListApiCall(ref _callAggregatedList); @@ -783,16 +876,22 @@ public TargetVpnGatewaysClientImpl(TargetVpnGateways.TargetVpnGatewaysClient grp return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified target VPN gateway. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteTargetVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteTargetVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteTargetVpnGatewayRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -801,10 +900,13 @@ public override Operation Delete(DeleteTargetVpnGatewayRequest request, gaxgrpc: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteTargetVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteTargetVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteTargetVpnGatewayRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -831,16 +933,22 @@ public override TargetVpnGateway Get(GetTargetVpnGatewayRequest request, gaxgrpc return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a target VPN gateway in the specified project and region using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertTargetVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertTargetVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertTargetVpnGatewayRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -849,10 +957,13 @@ public override Operation Insert(InsertTargetVpnGatewayRequest request, gaxgrpc: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertTargetVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertTargetVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertTargetVpnGatewayRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -916,4 +1027,18 @@ public partial class TargetVpnGatewayList : gaxgrpc::IPageResponse GetEnumerator(); } + + public static partial class TargetVpnGateways + { + public partial class TargetVpnGatewaysClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/UrlMapsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/UrlMapsClient.g.cs index eb8e7ffdbf31..25f4eb90af18 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/UrlMapsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/UrlMapsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -46,12 +47,17 @@ private UrlMapsSettings(UrlMapsSettings existing) : base(existing) gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); InvalidateCacheSettings = existing.InvalidateCacheSettings; + InvalidateCacheOperationsSettings = existing.InvalidateCacheOperationsSettings.Clone(); ListSettings = existing.ListSettings; PatchSettings = existing.PatchSettings; + PatchOperationsSettings = existing.PatchOperationsSettings.Clone(); UpdateSettings = existing.UpdateSettings; + UpdateOperationsSettings = existing.UpdateOperationsSettings.Clone(); ValidateSettings = existing.ValidateSettings; OnCopy(existing); } @@ -82,6 +88,24 @@ private UrlMapsSettings(UrlMapsSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to UrlMapsClient.Delete and UrlMapsClient.DeleteAsync + /// . + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to UrlMapsClient.Get and /// UrlMapsClient.GetAsync. @@ -106,6 +130,24 @@ private UrlMapsSettings(UrlMapsSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to UrlMapsClient.Insert and UrlMapsClient.InsertAsync + /// . + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// UrlMapsClient.InvalidateCache and UrlMapsClient.InvalidateCacheAsync. @@ -118,6 +160,24 @@ private UrlMapsSettings(UrlMapsSettings existing) : base(existing) /// public gaxgrpc::CallSettings InvalidateCacheSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to UrlMapsClient.InvalidateCache and + /// UrlMapsClient.InvalidateCacheAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InvalidateCacheOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to UrlMapsClient.List and /// UrlMapsClient.ListAsync. @@ -142,6 +202,23 @@ private UrlMapsSettings(UrlMapsSettings existing) : base(existing) /// public gaxgrpc::CallSettings PatchSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to UrlMapsClient.Patch and UrlMapsClient.PatchAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings PatchOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to UrlMapsClient.Update /// and UrlMapsClient.UpdateAsync. @@ -154,6 +231,24 @@ private UrlMapsSettings(UrlMapsSettings existing) : base(existing) /// public gaxgrpc::CallSettings UpdateSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to UrlMapsClient.Update and UrlMapsClient.UpdateAsync + /// . + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings UpdateOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to UrlMapsClient.Validate /// and UrlMapsClient.ValidateAsync. @@ -403,7 +498,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -412,7 +507,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -421,9 +516,35 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteUrlMapRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteUrlMapRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified UrlMap resource. /// @@ -435,7 +556,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string urlMap, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string urlMap, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteUrlMapRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -453,7 +574,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string urlMap, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string urlMap, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteUrlMapRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -471,7 +592,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string urlMap, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string urlMap, st::CancellationToken cancellationToken) => DeleteAsync(project, urlMap, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -557,7 +678,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -566,7 +687,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -575,9 +696,35 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertUrlMapRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertUrlMapRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a UrlMap resource in the specified project using the data included in the request. /// @@ -589,7 +736,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertUrlMapRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -607,7 +754,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertUrlMapRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -625,7 +772,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, UrlMap urlMapResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, UrlMap urlMapResource, st::CancellationToken cancellationToken) => InsertAsync(project, urlMapResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -636,7 +783,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation InvalidateCache(InvalidateCacheUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation InvalidateCache(InvalidateCacheUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -647,7 +794,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InvalidateCacheAsync(InvalidateCacheUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InvalidateCacheAsync(InvalidateCacheUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -658,9 +805,35 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InvalidateCacheAsync(InvalidateCacheUrlMapRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InvalidateCacheAsync(InvalidateCacheUrlMapRequest request, st::CancellationToken cancellationToken) => InvalidateCacheAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for InvalidateCache. + public virtual lro::OperationsClient InvalidateCacheOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of InvalidateCache. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInvalidateCache(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InvalidateCacheOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// InvalidateCache. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInvalidateCacheAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InvalidateCacheOperationsClient, callSettings); + /// /// Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. /// @@ -677,7 +850,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation InvalidateCache(string project, string urlMap, CacheInvalidationRule cacheInvalidationRuleResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation InvalidateCache(string project, string urlMap, CacheInvalidationRule cacheInvalidationRuleResource, gaxgrpc::CallSettings callSettings = null) => InvalidateCache(new InvalidateCacheUrlMapRequest { CacheInvalidationRuleResource = gax::GaxPreconditions.CheckNotNull(cacheInvalidationRuleResource, nameof(cacheInvalidationRuleResource)), @@ -701,7 +874,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InvalidateCacheAsync(string project, string urlMap, CacheInvalidationRule cacheInvalidationRuleResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InvalidateCacheAsync(string project, string urlMap, CacheInvalidationRule cacheInvalidationRuleResource, gaxgrpc::CallSettings callSettings = null) => InvalidateCacheAsync(new InvalidateCacheUrlMapRequest { CacheInvalidationRuleResource = gax::GaxPreconditions.CheckNotNull(cacheInvalidationRuleResource, nameof(cacheInvalidationRuleResource)), @@ -725,7 +898,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InvalidateCacheAsync(string project, string urlMap, CacheInvalidationRule cacheInvalidationRuleResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InvalidateCacheAsync(string project, string urlMap, CacheInvalidationRule cacheInvalidationRuleResource, st::CancellationToken cancellationToken) => InvalidateCacheAsync(project, urlMap, cacheInvalidationRuleResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -800,7 +973,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(PatchUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(PatchUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -809,7 +982,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(PatchUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -818,9 +991,35 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(PatchUrlMapRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(PatchUrlMapRequest request, st::CancellationToken cancellationToken) => PatchAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Patch. + public virtual lro::OperationsClient PatchOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Patch. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOncePatch(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Patch + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOncePatchAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), PatchOperationsClient, callSettings); + /// /// Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// @@ -835,7 +1034,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Patch(string project, string urlMap, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Patch(string project, string urlMap, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => Patch(new PatchUrlMapRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -857,7 +1056,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string urlMap, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> PatchAsync(string project, string urlMap, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => PatchAsync(new PatchUrlMapRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -879,7 +1078,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task PatchAsync(string project, string urlMap, UrlMap urlMapResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> PatchAsync(string project, string urlMap, UrlMap urlMapResource, st::CancellationToken cancellationToken) => PatchAsync(project, urlMap, urlMapResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -888,7 +1087,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(UpdateUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(UpdateUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -897,7 +1096,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(UpdateUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -906,9 +1105,35 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(UpdateUrlMapRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(UpdateUrlMapRequest request, st::CancellationToken cancellationToken) => UpdateAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Update. + public virtual lro::OperationsClient UpdateOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Update. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceUpdate(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Update + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceUpdateAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), UpdateOperationsClient, callSettings); + /// /// Updates the specified UrlMap resource with the data included in the request. /// @@ -923,7 +1148,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Update(string project, string urlMap, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Update(string project, string urlMap, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => Update(new UpdateUrlMapRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -945,7 +1170,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string urlMap, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> UpdateAsync(string project, string urlMap, UrlMap urlMapResource, gaxgrpc::CallSettings callSettings = null) => UpdateAsync(new UpdateUrlMapRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -967,7 +1192,7 @@ internal static UrlMapsClient Create(grpccore::CallInvoker callInvoker, UrlMapsS /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task UpdateAsync(string project, string urlMap, UrlMap urlMapResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> UpdateAsync(string project, string urlMap, UrlMap urlMapResource, st::CancellationToken cancellationToken) => UpdateAsync(project, urlMap, urlMapResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1093,6 +1318,11 @@ public UrlMapsClientImpl(UrlMaps.UrlMapsClient grpcClient, UrlMapsSettings setti GrpcClient = grpcClient; UrlMapsSettings effectiveSettings = settings ?? UrlMapsSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings); + InvalidateCacheOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InvalidateCacheOperationsSettings); + PatchOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.PatchOperationsSettings); + UpdateOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.UpdateOperationsSettings); _callAggregatedList = clientHelper.BuildApiCall(grpcClient.AggregatedListAsync, grpcClient.AggregatedList, effectiveSettings.AggregatedListSettings).WithGoogleRequestParam("project", request => request.Project); Modify_ApiCall(ref _callAggregatedList); Modify_AggregatedListApiCall(ref _callAggregatedList); @@ -1192,16 +1422,22 @@ public UrlMapsClientImpl(UrlMaps.UrlMapsClient grpcClient, UrlMapsSettings setti return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified UrlMap resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteUrlMapRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1210,10 +1446,13 @@ public override Operation Delete(DeleteUrlMapRequest request, gaxgrpc::CallSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteUrlMapRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1240,16 +1479,22 @@ public override UrlMap Get(GetUrlMapRequest request, gaxgrpc::CallSettings callS return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a UrlMap resource in the specified project using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertUrlMapRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1258,12 +1503,18 @@ public override Operation Insert(InsertUrlMapRequest request, gaxgrpc::CallSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertUrlMapRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } + /// The long-running operations client for InvalidateCache. + public override lro::OperationsClient InvalidateCacheOperationsClient { get; } + /// /// Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. /// @@ -1272,10 +1523,13 @@ public override Operation Insert(InsertUrlMapRequest request, gaxgrpc::CallSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation InvalidateCache(InvalidateCacheUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation InvalidateCache(InvalidateCacheUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InvalidateCacheUrlMapRequest(ref request, ref callSettings); - return _callInvalidateCache.Sync(request, callSettings); + Operation response = _callInvalidateCache.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InvalidateCacheOperationsClient); } /// @@ -1286,10 +1540,13 @@ public override Operation InvalidateCache(InvalidateCacheUrlMapRequest request, /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InvalidateCacheAsync(InvalidateCacheUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InvalidateCacheAsync(InvalidateCacheUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InvalidateCacheUrlMapRequest(ref request, ref callSettings); - return _callInvalidateCache.Async(request, callSettings); + Operation response = await _callInvalidateCache.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InvalidateCacheOperationsClient); } /// @@ -1316,16 +1573,22 @@ public override Operation InvalidateCache(InvalidateCacheUrlMapRequest request, return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for Patch. + public override lro::OperationsClient PatchOperationsClient { get; } + /// /// Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Patch(PatchUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Patch(PatchUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchUrlMapRequest(ref request, ref callSettings); - return _callPatch.Sync(request, callSettings); + Operation response = _callPatch.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } /// @@ -1334,22 +1597,31 @@ public override Operation Patch(PatchUrlMapRequest request, gaxgrpc::CallSetting /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task PatchAsync(PatchUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> PatchAsync(PatchUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_PatchUrlMapRequest(ref request, ref callSettings); - return _callPatch.Async(request, callSettings); + Operation response = await _callPatch.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), PatchOperationsClient); } + /// The long-running operations client for Update. + public override lro::OperationsClient UpdateOperationsClient { get; } + /// /// Updates the specified UrlMap resource with the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Update(UpdateUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Update(UpdateUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateUrlMapRequest(ref request, ref callSettings); - return _callUpdate.Sync(request, callSettings); + Operation response = _callUpdate.Sync(request, callSettings); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } /// @@ -1358,10 +1630,13 @@ public override Operation Update(UpdateUrlMapRequest request, gaxgrpc::CallSetti /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task UpdateAsync(UpdateUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> UpdateAsync(UpdateUrlMapRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateUrlMapRequest(ref request, ref callSettings); - return _callUpdate.Async(request, callSettings); + Operation response = await _callUpdate.Async(request, callSettings).ConfigureAwait(false); + GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), UpdateOperationsClient); } /// @@ -1416,4 +1691,18 @@ public partial class UrlMapsAggregatedList : gaxgrpc::IPageResponse GetEnumerator(); } + + public static partial class UrlMaps + { + public partial class UrlMapsClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to GlobalOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() => + GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/VpnGatewaysClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/VpnGatewaysClient.g.cs index e89f90ca2791..d639328c50d4 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/VpnGatewaysClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/VpnGatewaysClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -46,11 +47,14 @@ private VpnGatewaysSettings(VpnGatewaysSettings existing) : base(existing) gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; GetStatusSettings = existing.GetStatusSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; SetLabelsSettings = existing.SetLabelsSettings; + SetLabelsOperationsSettings = existing.SetLabelsOperationsSettings.Clone(); TestIamPermissionsSettings = existing.TestIamPermissionsSettings; OnCopy(existing); } @@ -81,6 +85,24 @@ private VpnGatewaysSettings(VpnGatewaysSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to VpnGatewaysClient.Delete and + /// VpnGatewaysClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to VpnGatewaysClient.Get /// and VpnGatewaysClient.GetAsync. @@ -117,6 +139,24 @@ private VpnGatewaysSettings(VpnGatewaysSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to VpnGatewaysClient.Insert and + /// VpnGatewaysClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to VpnGatewaysClient.List /// and VpnGatewaysClient.ListAsync. @@ -141,6 +181,24 @@ private VpnGatewaysSettings(VpnGatewaysSettings existing) : base(existing) /// public gaxgrpc::CallSettings SetLabelsSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to VpnGatewaysClient.SetLabels and + /// VpnGatewaysClient.SetLabelsAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings SetLabelsOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to /// VpnGatewaysClient.TestIamPermissions and VpnGatewaysClient.TestIamPermissionsAsync. @@ -391,7 +449,7 @@ internal static VpnGatewaysClient Create(grpccore::CallInvoker callInvoker, VpnG /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -400,7 +458,7 @@ internal static VpnGatewaysClient Create(grpccore::CallInvoker callInvoker, VpnG /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -409,9 +467,35 @@ internal static VpnGatewaysClient Create(grpccore::CallInvoker callInvoker, VpnG /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteVpnGatewayRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteVpnGatewayRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified VPN gateway. /// @@ -426,7 +510,7 @@ internal static VpnGatewaysClient Create(grpccore::CallInvoker callInvoker, VpnG /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string vpnGateway, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string vpnGateway, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteVpnGatewayRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -448,7 +532,7 @@ internal static VpnGatewaysClient Create(grpccore::CallInvoker callInvoker, VpnG /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string vpnGateway, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string vpnGateway, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteVpnGatewayRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -470,7 +554,7 @@ internal static VpnGatewaysClient Create(grpccore::CallInvoker callInvoker, VpnG /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string vpnGateway, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string vpnGateway, st::CancellationToken cancellationToken) => DeleteAsync(project, region, vpnGateway, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -655,7 +739,7 @@ internal static VpnGatewaysClient Create(grpccore::CallInvoker callInvoker, VpnG /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -664,7 +748,7 @@ internal static VpnGatewaysClient Create(grpccore::CallInvoker callInvoker, VpnG /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -673,9 +757,35 @@ internal static VpnGatewaysClient Create(grpccore::CallInvoker callInvoker, VpnG /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertVpnGatewayRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertVpnGatewayRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a VPN gateway in the specified project and region using the data included in the request. /// @@ -690,7 +800,7 @@ internal static VpnGatewaysClient Create(grpccore::CallInvoker callInvoker, VpnG /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, VpnGateway vpnGatewayResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, VpnGateway vpnGatewayResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertVpnGatewayRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -712,7 +822,7 @@ internal static VpnGatewaysClient Create(grpccore::CallInvoker callInvoker, VpnG /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, VpnGateway vpnGatewayResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, VpnGateway vpnGatewayResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertVpnGatewayRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -734,7 +844,7 @@ internal static VpnGatewaysClient Create(grpccore::CallInvoker callInvoker, VpnG /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, VpnGateway vpnGatewayResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, VpnGateway vpnGatewayResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, vpnGatewayResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -817,7 +927,7 @@ internal static VpnGatewaysClient Create(grpccore::CallInvoker callInvoker, VpnG /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetLabels(SetLabelsVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetLabels(SetLabelsVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -826,7 +936,7 @@ internal static VpnGatewaysClient Create(grpccore::CallInvoker callInvoker, VpnG /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(SetLabelsVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetLabelsAsync(SetLabelsVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -835,9 +945,35 @@ internal static VpnGatewaysClient Create(grpccore::CallInvoker callInvoker, VpnG /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(SetLabelsVpnGatewayRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetLabelsAsync(SetLabelsVpnGatewayRequest request, st::CancellationToken cancellationToken) => SetLabelsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for SetLabels. + public virtual lro::OperationsClient SetLabelsOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of SetLabels. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceSetLabels(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetLabelsOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of + /// SetLabels. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceSetLabelsAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), SetLabelsOperationsClient, callSettings); + /// /// Sets the labels on a VpnGateway. To learn more about labels, read the Labeling Resources documentation. /// @@ -855,7 +991,7 @@ internal static VpnGatewaysClient Create(grpccore::CallInvoker callInvoker, VpnG /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation SetLabels(string project, string region, string resource, RegionSetLabelsRequest regionSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation SetLabels(string project, string region, string resource, RegionSetLabelsRequest regionSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetLabels(new SetLabelsVpnGatewayRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -881,7 +1017,7 @@ internal static VpnGatewaysClient Create(grpccore::CallInvoker callInvoker, VpnG /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(string project, string region, string resource, RegionSetLabelsRequest regionSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> SetLabelsAsync(string project, string region, string resource, RegionSetLabelsRequest regionSetLabelsRequestResource, gaxgrpc::CallSettings callSettings = null) => SetLabelsAsync(new SetLabelsVpnGatewayRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -907,7 +1043,7 @@ internal static VpnGatewaysClient Create(grpccore::CallInvoker callInvoker, VpnG /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task SetLabelsAsync(string project, string region, string resource, RegionSetLabelsRequest regionSetLabelsRequestResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> SetLabelsAsync(string project, string region, string resource, RegionSetLabelsRequest regionSetLabelsRequestResource, st::CancellationToken cancellationToken) => SetLabelsAsync(project, region, resource, regionSetLabelsRequestResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -1042,6 +1178,9 @@ public VpnGatewaysClientImpl(VpnGateways.VpnGatewaysClient grpcClient, VpnGatewa GrpcClient = grpcClient; VpnGatewaysSettings effectiveSettings = settings ?? VpnGatewaysSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); + SetLabelsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.SetLabelsOperationsSettings); _callAggregatedList = clientHelper.BuildApiCall(grpcClient.AggregatedListAsync, grpcClient.AggregatedList, effectiveSettings.AggregatedListSettings).WithGoogleRequestParam("project", request => request.Project); Modify_ApiCall(ref _callAggregatedList); Modify_AggregatedListApiCall(ref _callAggregatedList); @@ -1134,16 +1273,22 @@ public VpnGatewaysClientImpl(VpnGateways.VpnGatewaysClient grpcClient, VpnGatewa return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified VPN gateway. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteVpnGatewayRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1152,10 +1297,13 @@ public override Operation Delete(DeleteVpnGatewayRequest request, gaxgrpc::CallS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteVpnGatewayRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -1206,16 +1354,22 @@ public override VpnGatewaysGetStatusResponse GetStatus(GetStatusVpnGatewayReques return _callGetStatus.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a VPN gateway in the specified project and region using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertVpnGatewayRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1224,10 +1378,13 @@ public override Operation Insert(InsertVpnGatewayRequest request, gaxgrpc::CallS /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertVpnGatewayRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -1254,16 +1411,22 @@ public override Operation Insert(InsertVpnGatewayRequest request, gaxgrpc::CallS return new gaxgrpc::GrpcPagedAsyncEnumerable(_callList, request, callSettings); } + /// The long-running operations client for SetLabels. + public override lro::OperationsClient SetLabelsOperationsClient { get; } + /// /// Sets the labels on a VpnGateway. To learn more about labels, read the Labeling Resources documentation. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation SetLabels(SetLabelsVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation SetLabels(SetLabelsVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetLabelsVpnGatewayRequest(ref request, ref callSettings); - return _callSetLabels.Sync(request, callSettings); + Operation response = _callSetLabels.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetLabelsOperationsClient); } /// @@ -1272,10 +1435,13 @@ public override Operation SetLabels(SetLabelsVpnGatewayRequest request, gaxgrpc: /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task SetLabelsAsync(SetLabelsVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> SetLabelsAsync(SetLabelsVpnGatewayRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_SetLabelsVpnGatewayRequest(ref request, ref callSettings); - return _callSetLabels.Async(request, callSettings); + Operation response = await _callSetLabels.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), SetLabelsOperationsClient); } /// @@ -1338,4 +1504,18 @@ public partial class VpnGatewayList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class VpnGateways + { + public partial class VpnGatewaysClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/VpnTunnelsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/VpnTunnelsClient.g.cs index 1a2f7afc1539..bd5d33db33bb 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/VpnTunnelsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/VpnTunnelsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -46,8 +47,10 @@ private VpnTunnelsSettings(VpnTunnelsSettings existing) : base(existing) gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); AggregatedListSettings = existing.AggregatedListSettings; DeleteSettings = existing.DeleteSettings; + DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone(); GetSettings = existing.GetSettings; InsertSettings = existing.InsertSettings; + InsertOperationsSettings = existing.InsertOperationsSettings.Clone(); ListSettings = existing.ListSettings; OnCopy(existing); } @@ -78,6 +81,24 @@ private VpnTunnelsSettings(VpnTunnelsSettings existing) : base(existing) /// public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to VpnTunnelsClient.Delete and + /// VpnTunnelsClient.DeleteAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to VpnTunnelsClient.Get /// and VpnTunnelsClient.GetAsync. @@ -102,6 +123,24 @@ private VpnTunnelsSettings(VpnTunnelsSettings existing) : base(existing) /// public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None); + /// + /// Long Running Operation settings for calls to VpnTunnelsClient.Insert and + /// VpnTunnelsClient.InsertAsync. + /// + /// + /// Uses default of: + /// + /// Initial delay: 20 seconds. + /// Delay multiplier: 1.5 + /// Maximum delay: 45 seconds. + /// Total timeout: 24 hours. + /// + /// + public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings + { + DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)), + }; + /// /// for synchronous and asynchronous calls to VpnTunnelsClient.List /// and VpnTunnelsClient.ListAsync. @@ -352,7 +391,7 @@ internal static VpnTunnelsClient Create(grpccore::CallInvoker callInvoker, VpnTu /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(DeleteVpnTunnelRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(DeleteVpnTunnelRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -361,7 +400,7 @@ internal static VpnTunnelsClient Create(grpccore::CallInvoker callInvoker, VpnTu /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteVpnTunnelRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(DeleteVpnTunnelRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -370,9 +409,35 @@ internal static VpnTunnelsClient Create(grpccore::CallInvoker callInvoker, VpnTu /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(DeleteVpnTunnelRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(DeleteVpnTunnelRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Delete. + public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Delete. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Delete + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings); + /// /// Deletes the specified VpnTunnel resource. /// @@ -387,7 +452,7 @@ internal static VpnTunnelsClient Create(grpccore::CallInvoker callInvoker, VpnTu /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Delete(string project, string region, string vpnTunnel, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Delete(string project, string region, string vpnTunnel, gaxgrpc::CallSettings callSettings = null) => Delete(new DeleteVpnTunnelRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -409,7 +474,7 @@ internal static VpnTunnelsClient Create(grpccore::CallInvoker callInvoker, VpnTu /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string vpnTunnel, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> DeleteAsync(string project, string region, string vpnTunnel, gaxgrpc::CallSettings callSettings = null) => DeleteAsync(new DeleteVpnTunnelRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -431,7 +496,7 @@ internal static VpnTunnelsClient Create(grpccore::CallInvoker callInvoker, VpnTu /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task DeleteAsync(string project, string region, string vpnTunnel, st::CancellationToken cancellationToken) => + public virtual stt::Task> DeleteAsync(string project, string region, string vpnTunnel, st::CancellationToken cancellationToken) => DeleteAsync(project, region, vpnTunnel, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -528,7 +593,7 @@ internal static VpnTunnelsClient Create(grpccore::CallInvoker callInvoker, VpnTu /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(InsertVpnTunnelRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(InsertVpnTunnelRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -537,7 +602,7 @@ internal static VpnTunnelsClient Create(grpccore::CallInvoker callInvoker, VpnTu /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertVpnTunnelRequest request, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(InsertVpnTunnelRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException(); /// @@ -546,9 +611,35 @@ internal static VpnTunnelsClient Create(grpccore::CallInvoker callInvoker, VpnTu /// The request object containing all of the parameters for the API call. /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(InsertVpnTunnelRequest request, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(InsertVpnTunnelRequest request, st::CancellationToken cancellationToken) => InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); + /// The long-running operations client for Insert. + public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException(); + + /// + /// Poll an operation once, using an operationName from a previous invocation of Insert. + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// The result of polling the operation. + public virtual lro::Operation PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + + /// + /// Asynchronously poll an operation once, using an operationName from a previous invocation of Insert + /// . + /// + /// + /// The name of a previously invoked operation. Must not be null or empty. + /// + /// If not null, applies overrides to this RPC call. + /// A task representing the result of polling the operation. + public virtual stt::Task> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) => + lro::Operation.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings); + /// /// Creates a VpnTunnel resource in the specified project and region using the data included in the request. /// @@ -563,7 +654,7 @@ internal static VpnTunnelsClient Create(grpccore::CallInvoker callInvoker, VpnTu /// /// If not null, applies overrides to this RPC call. /// The RPC response. - public virtual Operation Insert(string project, string region, VpnTunnel vpnTunnelResource, gaxgrpc::CallSettings callSettings = null) => + public virtual lro::Operation Insert(string project, string region, VpnTunnel vpnTunnelResource, gaxgrpc::CallSettings callSettings = null) => Insert(new InsertVpnTunnelRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -585,7 +676,7 @@ internal static VpnTunnelsClient Create(grpccore::CallInvoker callInvoker, VpnTu /// /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, VpnTunnel vpnTunnelResource, gaxgrpc::CallSettings callSettings = null) => + public virtual stt::Task> InsertAsync(string project, string region, VpnTunnel vpnTunnelResource, gaxgrpc::CallSettings callSettings = null) => InsertAsync(new InsertVpnTunnelRequest { Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)), @@ -607,7 +698,7 @@ internal static VpnTunnelsClient Create(grpccore::CallInvoker callInvoker, VpnTu /// /// A to use for this RPC. /// A Task containing the RPC response. - public virtual stt::Task InsertAsync(string project, string region, VpnTunnel vpnTunnelResource, st::CancellationToken cancellationToken) => + public virtual stt::Task> InsertAsync(string project, string region, VpnTunnel vpnTunnelResource, st::CancellationToken cancellationToken) => InsertAsync(project, region, vpnTunnelResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken)); /// @@ -711,6 +802,8 @@ public VpnTunnelsClientImpl(VpnTunnels.VpnTunnelsClient grpcClient, VpnTunnelsSe GrpcClient = grpcClient; VpnTunnelsSettings effectiveSettings = settings ?? VpnTunnelsSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); + DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.DeleteOperationsSettings); + InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForRegionOperations(), effectiveSettings.InsertOperationsSettings); _callAggregatedList = clientHelper.BuildApiCall(grpcClient.AggregatedListAsync, grpcClient.AggregatedList, effectiveSettings.AggregatedListSettings).WithGoogleRequestParam("project", request => request.Project); Modify_ApiCall(ref _callAggregatedList); Modify_AggregatedListApiCall(ref _callAggregatedList); @@ -782,16 +875,22 @@ public VpnTunnelsClientImpl(VpnTunnels.VpnTunnelsClient grpcClient, VpnTunnelsSe return new gaxgrpc::GrpcPagedAsyncEnumerable>(_callAggregatedList, request, callSettings); } + /// The long-running operations client for Delete. + public override lro::OperationsClient DeleteOperationsClient { get; } + /// /// Deletes the specified VpnTunnel resource. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Delete(DeleteVpnTunnelRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Delete(DeleteVpnTunnelRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteVpnTunnelRequest(ref request, ref callSettings); - return _callDelete.Sync(request, callSettings); + Operation response = _callDelete.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -800,10 +899,13 @@ public override Operation Delete(DeleteVpnTunnelRequest request, gaxgrpc::CallSe /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task DeleteAsync(DeleteVpnTunnelRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> DeleteAsync(DeleteVpnTunnelRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteVpnTunnelRequest(ref request, ref callSettings); - return _callDelete.Async(request, callSettings); + Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient); } /// @@ -830,16 +932,22 @@ public override VpnTunnel Get(GetVpnTunnelRequest request, gaxgrpc::CallSettings return _callGet.Async(request, callSettings); } + /// The long-running operations client for Insert. + public override lro::OperationsClient InsertOperationsClient { get; } + /// /// Creates a VpnTunnel resource in the specified project and region using the data included in the request. /// /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// The RPC response. - public override Operation Insert(InsertVpnTunnelRequest request, gaxgrpc::CallSettings callSettings = null) + public override lro::Operation Insert(InsertVpnTunnelRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertVpnTunnelRequest(ref request, ref callSettings); - return _callInsert.Sync(request, callSettings); + Operation response = _callInsert.Sync(request, callSettings); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -848,10 +956,13 @@ public override Operation Insert(InsertVpnTunnelRequest request, gaxgrpc::CallSe /// The request object containing all of the parameters for the API call. /// If not null, applies overrides to this RPC call. /// A Task containing the RPC response. - public override stt::Task InsertAsync(InsertVpnTunnelRequest request, gaxgrpc::CallSettings callSettings = null) + public override async stt::Task> InsertAsync(InsertVpnTunnelRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_InsertVpnTunnelRequest(ref request, ref callSettings); - return _callInsert.Async(request, callSettings); + Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false); + GetRegionOperationRequest pollRequest = GetRegionOperationRequest.FromInitialResponse(response); + request.PopulatePollRequestFields(pollRequest); + return new lro::Operation(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient); } /// @@ -914,4 +1025,18 @@ public partial class VpnTunnelList : gaxgrpc::IPageResponse sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator(); } + + public static partial class VpnTunnels + { + public partial class VpnTunnelsClient + { + /// + /// Creates a new instance of using the same call invoker as + /// this client, delegating to RegionOperations. + /// + /// A new Operations client for the same target as this client. + public virtual lro::Operations.OperationsClient CreateOperationsClientForRegionOperations() => + RegionOperations.RegionOperationsClient.CreateOperationsClient(CallInvoker); + } + } } diff --git a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ZoneOperationsClient.g.cs b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ZoneOperationsClient.g.cs index c5ac544c8fa1..84f5fa0733fe 100644 --- a/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ZoneOperationsClient.g.cs +++ b/apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1/ZoneOperationsClient.g.cs @@ -17,6 +17,7 @@ using gax = Google.Api.Gax; using gaxgrpc = Google.Api.Gax.Grpc; +using lro = Google.LongRunning; using proto = Google.Protobuf; using grpccore = Grpc.Core; using grpcinter = Grpc.Core.Interceptors; @@ -802,4 +803,21 @@ public int PageSize set => MaxResults = checked((uint)value); } } + + public static partial class ZoneOperations + { + public partial class ZoneOperationsClient + { + /// + /// Creates a new instance of using the specified call + /// invoker, but redirecting Google.LongRunning RPCs to ZoneOperations RPCs. + /// + /// A new Operations client for the same target as this client. + internal static lro::Operations.OperationsClient CreateOperationsClient(grpccore::CallInvoker callInvoker) + { + grpccore::CallInvoker forwardingCallInvoker = gaxgrpc::ForwardingCallInvoker.Create(callInvoker, "/google.longrunning.Operations/GetOperation", __Method_Get, GetZoneOperationRequest.ParseLroRequest, (request, response) => response.ToLroResponse(request.Name)); + return new lro::Operations.OperationsClient(forwardingCallInvoker); + } + } + } } diff --git a/apis/Google.Cloud.Compute.V1/synth.metadata b/apis/Google.Cloud.Compute.V1/synth.metadata index fed842f7c8fd..937354e43ee6 100644 --- a/apis/Google.Cloud.Compute.V1/synth.metadata +++ b/apis/Google.Cloud.Compute.V1/synth.metadata @@ -11,7 +11,7 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "409e134ffaacc243052b08e6fb8e2d458014ed37" + "sha": "9bac62dbc7a1f7b19baf578d6fbb550dbaff0d49" } } ]